sending data from appcontroller to default.ctp - CakePHP
- by Astral Projection Forum
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?