I created a navigation menu in yii2 and i have links generated by the following code:
<?= HeaderNavigation::widget([ 'options' => ['class' => 'nav nav-tabs border-0 flex-column flex-lg-row'], 'itemOptions' => [ 'class' => 'nav-item', ], 'items' => [ [ 'label' => Yii::t('lang', 'Browse'), 'url' => ['directory/index'], 'icon' => 'home', 'title' => 'HELLO WORLD' ], ], ]) ?>
but title attribute doesn’t work. What i m doing wrong??
Advertisement
Answer
OK, finally i managed to make it work with the help of Michal HynĨica.
I had to use options
key:
'options' => ['title' => 'HELLO WORLD'],
so the code should be:
'items' => [ [ 'options' => ['title' => 'HELLO WORLD'], 'label' => Yii::t('lang', 'Browse'), 'url' => ['directory/index'], 'icon' => 'home', 'title' => 'HELLO WORLD' ],