I'm experience some troubles with module routes and main menu widget.
The trouble is that MainMenu tabs are not highlighted when I'm in the modules controller.
I've tried to fix that and got that problem is that $controller->uniqueID for module controller is <module>/<controller>, and if I pass 'pattern' param for that controller id like
array('label'=>'REgions', 'url'=>array('/regions'), 'visible'=>!Yii::app()->user->isGuest, 'pattern'=>array('regions/region')),
It interprets its like an controller and action, and because of this I can't highlight one tab for all actions of modules controller.
How can I intelligent fix this?
for now I did this solution:
if(strpos($controllerID,'/')!==false) { // controller belongs to module $controllerID = array_pop(explode('/', $controllerID)); }
So I'm just remove module name from controller id. This works, but if I'll have to modules with default controller this definatly will not work.
Thanks in advance