Closed kwazaro closed 8 years ago
$categories = Categories::findOne(['id' => $model->id]);
$parents = $categories->parents()->all();
$this->title = $model->title;
if($parents){
foreach ($parents as $item) {
$this->params['breadcrumbs'][] = ['label' => $item->title, 'url' => ['**/catalog/categories/view**', 'id' => $item->id]];
}
}
$this->params['breadcrumbs'][] = $this->title;
P.S. change url (/catalog/categories/view)
Thanks!
How to get data in format for yii\widgets\Breadcrumbs for node?