Answer the question
In order to leave comments, you need to log in
How to style menu items in Menu::widget?
Hello everybody! Please tell me how to add one more span to the menu item in Menu::widget. Currently, when using this design
['label' => 'Обращения', 'icon' => 'commenting-o', 'url' => '/contact-form/index',],
<a href="/contact-form/index">
<i class="fa fa-commenting-o"></i>
<span>Обращения</span>
</a>
<a href="/contact-form/index">
<i class="fa fa-commenting-o"></i>
<span>Обращения</span>
<span class="pull-right-container">
<span class="label label-primary pull-right">
<?= $count_contact; ?>
</span>
</span>
</a>
Answer the question
In order to leave comments, you need to log in
Good afternoon.
In addition to doing what @kawabanga wrote (although it would be more correct to use encodeLabel), you can try to further customize the widget using the following methods:
$labelTemplate
$lastItemCssClass
$linkTemplate
$submenuTemplate
and a bunch of other ways.
More details here .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question