trance
(Tranceorder)
May 22, 2015, 11:20am
1
Inside my NavBar widget I am generating menu link like this:
$menuItems[] = ['label' => Yii::t('app', 'My Pages'), 'url' => ['/home/my-pages'], 'options' => ['class' => 'my-pages']];
I am trying to add css class of ‘my-pages’ to the link “<a>” inside the <li>. But this code actually adds css class to <li> and not the actual <a> that is inside of it.
How can I add css classed to link insde ?
amit5992
(Gupta5992amit)
May 22, 2015, 11:55am
2
trance:
Inside my NavBar widget I am generating menu link like this:
$menuItems[] = ['label' => Yii::t('app', 'My Pages'), 'url' => ['/home/my-pages'], 'options' => ['class' => 'my-pages']];
I am trying to add css class of ‘my-pages’ to the link “<a>” inside the <li>. But this code actually adds css class to <li> and not the actual <a> that is inside of it.
How can I add css classed to link insde ?
[ 'label'=> Yii::t('app', 'My Pages'), 'url'=>['/home/my-pages'], 'linkOptions'=> ['class' => 'my-pages'],]