the following code:
<style type='text/css'>.fontWeightBold{font-weight:bold}</style>
<?php
echo \yii\widgets\Menu::widget([
'items'=>[
['label'=>'Home','url'=>['site/index']],
['label'=>'Contact','url'=>['site/contact']],
['label'=>'About','url'=>['site/about']]
],
'activeCssClass'=>'fontWeightBold',
]);
?>
give HTML OUTPUT as following
<style type='text/css'>.fontWeightBold{font-weight:bold}</style>
<ul>
<li><a href="/yii_basic_2_0_2/web/index.php?r=site%2Findex">Home</a></li>
<li><a href="/yii_basic_2_0_2/web/index.php?r=site%2Fcontact">Contact</a></li>
<li><a href="/yii_basic_2_0_2/web/index.php?r=site%2Fabout">About</a></li>
</ul>
My Question: What is the effect of line (‘activeCssClass’=>‘fontWeightBold’,) on the code
webin2015
(Webin2015)
2
I have used your code in my app.
activecssclass changes css of current url.
<li class="fontWeightBold"><a href="/yii2demo/site/contact">Contact</a></li>
so contact link get BOLD.
regards,
webin
thanks, webin
my app version is 2.0.2
Is this the reason???
what is your version???
how do I contact link get BOLD??? I do not understand that .
thanks, webin
now, I understand what you mean .