Cmenu ActivateParent

how does this work? i have a code like this


array('label'=> 'Users', 'url'=>array('/admin/users'), 'activateParents'=>true,

            'items'=>array(

              array('url'=>array('admin/adduser'),'visible'=>false),

            )),

I want to activate the parent menu automatically if the requested route matches the route setting of the child.

thanks

Solution




array('label'=>  _t('Users'), 'url'=>array('/admin/users'), 

            'active'=>(

              ($this->action->id=='users') || 

              (($this->action->id=='adduser') && !$_REQUEST['broker'])  || 

              (($this->action->id=='edituser') && !$_REQUEST['broker'])  || 

              (($this->action->id=='viewuser') && !$_REQUEST['broker'])  

            ),

        ),