Cmenu manage list

Ther’s a way to manage the Cmenu output list, I wanto to obtain this kind of list

<ul>

<li>

<ol>

<li>

</li>

</ol>

</li>

</ul>

thanks all.

Looking at the CMenu.php widget class i noticed that it hardcodes the ul/li tags so the by default you won’t be able to do that without overriding that class. But if you do override this should be simple enough to implement.

how to extend this class? because i need to move the class=‘active’ from the li to the a tag

Thanks but i already solved the problem thanx all

You simple create a new class with a new like ‘MyCMenu’ that extends the defualt CMenu class. And you override the methods you need to change their behavior.

But before you run ahead and extend the class you might want to check the linkOptions attribute in the items element.

http://www.yiiframework.com/doc/api/CMenu#items-detail

i got this: YiiBase::include(CMenu.php) [<a href=‘yiibase.include’>yiibase.include</a>]: failed to open stream: No such file or directory

framework\zii\widgets\MyCMenu.php




<?php


class MyCMenu extends CMenu

{

	//just testing

	public function run()

	{

		echo 'bas';

	}


}



Since the CMenu located under the Zii library you need to import it by adding this line to the top of you class file


Yii::import('system.zii.widgets.CMenu');

So it looks like this:


<?php


Yii::import('system.zii.widgets.CMenu');


class MyCMenu extends CMenu

{

        //just testing

        public function run()

        {

                echo 'bas';

        }


}

That should work.

another question how I can set a css class to link Cmenu generated class?

I find sorry.