Answer the question
In order to leave comments, you need to log in
How to change breadcrumbs in Yii2?
Guys, please tell me how to add a class to a link in breadcrumbs?
<?= Breadcrumbs::widget([
'options' => [
'id' => 'bread',
'class' => isset($viewBlock->viewBlockContent) ? 'has-border' : '',
],
'homeLink' => [
'label' => Yii::t('footer', 'home.link'),
'url' => Url::to(['/']),
],
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
'itemTemplate' => '<li>{link}</li>',
'activeItemTemplate' => '<li><span>{link}</span></li>',
]); ?>
Answer the question
In order to leave comments, you need to log in
for example like this:
'homeLink' => [
'label' => Yii::t('footer', 'home.link'),
'url' => Url::to(['/']),
'class' => 'myclass',
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question