Search code examples
phpcodeigniterpyrocms

PyroCMS Dynamic info menu


In PyroCMS you can create a submenu for your custom module using the

$info['sections'][...] 

array. Rather than returning the same menu, based on the current section the user is in I want to offer a seperate menu.

Something like this;

if($section =='my_order')
{
   return $info = array(...);
}
else
{
   return $info = array(...);
}

But Im not sure how to check which section the user is in in the details.php file

any suggestions ideas greatly appreciated.

Im using PyroCMS 2.2


Solution

  • If the section is in the URL, that's an easy way.

    http://ellislab.com/codeigniter/user-guide/libraries/uri.html

    if($this->uri->segment(2) == 'my_order'){
        ...