In the below code linkOptions , submenuOptions , itemOptions are not working. Also how do i prevent encoding of a single item not entire menu
'linkOptions '=> array('encode'=>false, 'class'=>'dropdown-toggle', 'data-toggle'=>'dropdown'),
'itemOptions '=> array('class'=>'dropdown'),
'submenuOptions '=> array('class'=>'dropdown-menu'),
'htmlOptions' => array('class' => 'nav')
October 24, 2012, 8:14am
There is no such thing like
submenuOptions. I think you’re talking about submenuHtmlOptions. Correct your code and check, if the problem has been solved.
CMenu is generally a very poor menu system. It is mainly designed as a base widget for extending it by a developers. Consider using something else instead. There are many Yii menu extensions. From simple one (I tested MbMenu and found it very nice) to a whole widget sets, which include menu, like Bootstrap or others.
Thanks For the reply but this too didn’t work. I think i will stick to simple html. I don’t want to use a extension for this
October 25, 2012, 9:04pm
Well… I think that even CMenu should have a good support for styling/classing submenus.
If you’re sure, that this is a bug, the post in Bug Discusions forum or open a issue at Github to report it.
October 31, 2012, 3:41pm
awebdeveloper, I am doing the same thing what you and i found the solution; you need add ‘encodeLabel’ => false to your first items array.
My code look that:
$arrMenu = array(
'id' => 'nav',
'encodeLabel' => false,
'htmlOptions' => array('class' => 'nav'),
'items' => $arrItems,