This is my first extension, so any feedback and comments will be apperciated.
There are times when one needs to make the main menu item (which does not have any sub-menu) show as active for its corresponding related links; just like for the crud operation where create, update and admin type of links, the menu item will not display in active state.
Requirements ¶
Tested with Yii 1.1.10 and 1.1.12. may work on other versions
Usage ¶
This extension can be used same as CMenu except it take one extra parameter in-order to display the result, which is:
- $related_links_arr: an array of the related links which you want to associate with the menu item.
For the demonstration purpose, i have used this widget with default menu items.
$this->widget('ext.rlmenu.RLMenu', array(
'items' => array(
array('label' => 'Home', 'url' => array('/site/index')),
array('label' => 'Project', 'url' => array('/project/index'), 'relatedLinks' => array('/project/create', '/project/admin', '/project/view', '/project/update')),
array('label' => 'Contact', 'url' => array('/site/contact')),
array('label' => 'Login', 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest),
array('label' => 'Logout (' . Yii::app()->user->name . ')', 'url' => array('/site/logout'), 'visible' => !Yii::app()->user->isGuest)
),
));
any demo
pls show a demo.....
nice
thanks soooooooooo much , i was looking for this exactly.
Added demo link
I have added a demo link for this extension, please check it out.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.