Cmenu In Module

When I use CMenu widget in a module, it doesn’t highlight the active link by default:




<?php $this->widget('zii.widgets.CMenu', array(

	'items'=>array(

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

	),

)); ?>

This same code works fine in main application but just not in a module.

For the highlight to work I have to do this:


<?php $this->widget('zii.widgets.CMenu', array(

	'items'=>array(

		array('label'=>'Home', 'url'=>array('default/index'), 'active'=>$this->id == 'default'),

	),

)); ?>

Or this:


<?php $this->widget('zii.widgets.CMenu', array(

	'items'=>array(

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

	),

)); ?>

Is this a bug or am I doing something wrong?

hi try to add a slash in the front that might do the trick




...

// like soo

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

...

Yes that does work - however I wanted to have this as a reusable widget across modules - so therefore I don’t want to specify the module name in the url.

Since it generates the correct url I don’t understand why it fails to highlight the active link.

Anybody got any idea?