sending data from appcontroller to default.ctp - CakePHP

Posted by Astral Projection Forum on Stack Overflow See other posts from Stack Overflow or by Astral Projection Forum
Published on 2012-04-13T09:59:29Z Indexed on 2012/04/13 11:29 UTC
Read the original article Hit count: 165

I want to send the below data to default.ctp, I want to display menus in all the pages, I'm using Auth, The problem is if I'm logged in I get the Menus correctly, but if I logout, I'm getting error saying variable'$topMenu' not found.
The MenuController can be accessed only if logged in.

$this->loadModel('Menu');
$this->set('topMenu',$this->Menu->find('all'));

Any help on how to solve this?

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about application