Trying to understand the best method for creating my navigation. One
of my controllers selects my top level items (which I want to be
displayed on every page as the navigation elements).

I've currently created the following in my app_controller.php file:
 function beforeRender(){
        if(!$this->Session->read('nav')){
                $this->Session->write('nav', $this->Controller->find('all',
array('fields'=>array('Controller.name','Controller.id'))));
        }
        $this->set('primaryNav', $this->Session->read('nav'));
  }

On my template page, I was going to add:
 echo($this->element('navigation', array('header'=>$primaryNav,
'cache'=>true)));

however it seems as if this $primaryNav is now on any page, and thus
creating this call to the element passing primaryNav seems rather
pointless (or am I wrong?).. How can I create a cache for it, since it
is something I don't expect to be changing in the near future.

Thank you

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to