I have below code to create navigation menu using YiiStrap widget Tbnav .
$this->widget('TbNav', array(
'htmlOptions' => array(
'class' => 'navbar-left',
'id' => 'category-menu'
) ,
'encodeLabel' => false,
'activateItems' => false,
'items' => array(
array(
'htmlOptions' => [
'class' => 'submenu-bar',
'id' => 'main-nav'
],
'activateParents' => true,
'label' => '<span class="glyphicon glyphicon-th" style="margin-right:5px;"></span> Categories',
'items' => array_merge(
array(
array(
'label' => 'Browse All',
'url' => array('mylink/all')
) ,
TbHtml::menuDivider()
) ,
array(
array(
'label' => 'Category 1',
'url' => array('list/cat1')
)
),
array(
array(
'label' => 'Category 2',
'url' => array('list/cat2')
)
)
) ,
) ,
) ,
));
And it generates below HTML code
<ul role="menu" id="category-menu" class="navbar-left nav navbar-nav">
<li role="menuitem" activateparents="1" id="main-nav" class="submenu-bar dropdown"><a href="" data-toggle="dropdown" class="dropdown-toggle"><span style="margin-right:5px;" class="glyphicon glyphicon-th"></span> Categories <b class="caret"></b></a>
<ul role="menu" aria-labelledby="yt0" id="yt0" class="dropdown-menu">
<li role="menuitem"><a href="/mylink/all" tabindex="-1">Browse All</a></li>
<li class="divider"></li>
<li role="menuitem"><a href="/list/cat1" tabindex="-1">Category 1</a></li>
<li role="menuitem"><a href="/list/cat2" tabindex="-1">Category 2</a></li>
</ul>
</li>
How can i change id or add class to ul element having class="dropdown-menu".
[b]<ul role="menu" aria-labelledby="yt0" id="yt0" class="dropdown-menu">
[/b]
I have tried adding submenuHtmlOptions but it gives me error .