How to add css class to NavBar link

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'],]