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.
Page 1 of 1
Cmenu manage list
#2
Posted 13 April 2010 - 08:43 AM
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.
#3
Posted 13 April 2010 - 08:57 AM
Vince., on 13 April 2010 - 08:43 AM, said:
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
#5
Posted 13 April 2010 - 01:53 PM
bas_vdl, on 13 April 2010 - 08:57 AM, said:
how to extend this class? because i need to move the class='active' from the li to the a tag
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.yiiframew...nu#items-detail
#6
Posted 14 April 2010 - 01:38 AM
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
framework\zii\widgets\MyCMenu.php
<?php
class MyCMenu extends CMenu
{
//just testing
public function run()
{
echo 'bas';
}
}
#7
Posted 14 April 2010 - 02:20 AM
Since the CMenu located under the Zii library you need to import it by adding this line to the top of you class file
So it looks like this:
That should work.
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.
#8
Posted 14 April 2010 - 03:59 PM
another question how I can set a css class to link Cmenu generated class?
Share this topic:
Page 1 of 1

Help














