Hello everyone.

I'm trying to build a simple dropdown menu for a website. I'm using this
tutorial:
http://www.palivoda.eu/2008/04/dynamic-menu-in-cakephp/

THe menu is working, but I don't know how can I pass the array with all the
data to build the menu from the app_controller to the menu component. 

I was using a simple element menu, with this in my appcontroller's
beforeFilter:

function _setLayoutFrontEnd()
    {
        $this->layout = 'default';
        $this->_loadMenu();
    }

    function _loadMenu()
    {
                $categories = $this->Category->find('all',array(
                'conditions'=>array('Category.ativo'=>1),
                'order'=> array('Category.indexpag'=>'ASC')
        ));
        $this->set('categories',$categories);
}

With that, I could use the array $categories in my view/elements/menu.ctp. 

Now I need to pass it to my controllers/components/menu.php. 
How can I do that?

Thanks!!!
-- 
View this message in context: 
http://www.nabble.com/how-can-I-pass-variable-from-app_controller-to-a-component--tp25530525p25530525.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~---------~--~----~------------~-------~--~----~
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