Answer the question
In order to leave comments, you need to log in
How to use the breadcrumb widget correctly?
There are two types say parent and child in the parent I use breadcrumbs so $this->params['breadcrumbs'][] = $this->title;
where $this->title is the title of the page (there may be many and not known in advance) the question is how can I use breadcrumbs in child so that the first link would come title parent c which the user has passed and a link to it.
Answer the question
In order to leave comments, you need to log in
The question is a little vague. But if I correctly understood the question itself, then you need to organize the logic so that each child knows its parent. Then, by iterating in the parent cycle, you can output the entire chain into breadcrumbs.
Use URL Remember .
Quote from the docs:
There are tasks where you need to remember the URL and then use it in the course of one or more subsequent requests. This can be achieved like this:
// Запомнить текущий URL
Url::remember();
// Запомнить определенный URL. Входные параметры смотрите на примере Url::to().
Url::remember(['product/view', 'id' => 42]);
// Запомнить URL под определенным именем
Url::remember(['product/view', 'id' => 42], 'product');
$url = Url::previous();
$productUrl = Url::previous('product');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question