In CMenu ' id 'property seem don't work in the branching system......

Good morning guys,

I am a new user of YII Framework.

I want to set the html "id" attribute for my CMenu root + branch container tag, so

$this->widget(‘zii.widgets.CMenu’,array(

                'id'=>'main_ul',


                'items'=>array(


                    array('label'=>'ABC Index', 'url'=>array('/abc/index')),


                    array('label'=>'ABC Show', 'url'=>array('/abc/show')),


                    array('label'=>'XYZ Index', 'url'=>array('/xyz/index'),'','items'=>array(


                        


                        array('label'=>'XYZ Index', 'url'=>array('/xyz/index')),


                        array('label'=>'XYZ Show', 'url'=>array('/xyz/show')),


                        array('label'=>'Home', 'url'=>array('/abc/index'))


                    )),


                    array('label'=>'Index', 'url'=>array('/index/home'))


                ))); ?>

the output was

<ul id="main_ul">

&lt;li&gt;&lt;a href=&quot;/own/index.php?r=laureal/index&quot;&gt;Laureal Index&lt;/a&gt;&lt;/li&gt;


&lt;li&gt;&lt;a href=&quot;/own/index.php?r=laureal/show&quot;&gt;Laureal Show&lt;/a&gt;&lt;/li&gt;


&lt;li&gt;&lt;a href=&quot;/own/index.php?r=form/index&quot;&gt;Form Index&lt;/a&gt;


    &lt;ul&gt;


        &lt;li&gt;&lt;a href=&quot;/own/index.php?r=form/abc&quot;&gt;Form ABC&lt;/a&gt;&lt;/li&gt;


        &lt;li&gt;&lt;a href=&quot;/own/index.php?r=form/xyz&quot;&gt;Form XYZ&lt;/a&gt;&lt;/li&gt;


        &lt;li&gt;&lt;a href=&quot;/own/index.php?r=form/index&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;


    &lt;/ul&gt;


&lt;/li&gt;


&lt;li&gt;&lt;a href=&quot;/own/index.php?r=form/show&quot;&gt;Form Show&lt;/a&gt;&lt;/li&gt;

</ul>

The root id is available but how should I set the sub <ul> id?

Thanks

Hi and welcome to the Yii forum

You can use "submenuHtmlOptions" - http://www.yiiframew…lOptions-detail

This applies to all submenus…

If you need a different option for a certain submenu you can use "submenuOptions" for that item - http://www.yiiframew…nu#items-detail

NOTE: when you post code… use the code button (<> on the editor toolbar) so that your code is more readable… you can even edit your post to add that…