I have a gii generated view.php page, which can be reached from two different paths, but the breadcrumbs is the same. Anyone know how to fix?
Let me explain: I have the view.php view which shows the summary of the report made and can be reached from two paths:
- when I create a new report and therefore the path should be HOME / CREATION / VIEW;
- and also from a section that shows the user the summary of the reports she sent and therefore the breadcrumbs should be HOME / SUMMARY / VIEW.
Send a query variable on each link or in the redirection to manually build the breadcumb. Like:
$value = Yii::$app->request->getQueryParam('breadcumb')
Other option is to get the referrer url. And base on the value you can pass it to the switch. You can get referrer's url using:
$value = Yii::$app->request->getReferrer()
.Then do a switch to build the link:
Then just do something like this:
$this->params['breadcrumbs'][] = ['label' => $label, 'url' => $url];