Answer the question
In order to leave comments, you need to log in
How to pass a value to TITLE when filtering?
The following is passed to the title:
@section('title', $category ? $category->seo_title : '')
@section('title', 'Категория - '.$category->seo_title. ' - город '.$city->name. ' - город' .$city->name)
@section('title', $category ? .$category->seo_title. $city ? .$city->name. : '')
Answer the question
In order to leave comments, you need to log in
Move the title formation logic into the controller.
Do not shove everything in one line, do it consistently so as not to get confused, like
$title = '';
$title .= $category ? 'Категория - ' . $category->seo_title : '';
$title .= $city ? 'Город - ' . $city->name : '';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question