How can I put it in the app_controller? What code I have to use?
On Feb 25, 9:06 am, Aivaras <faifas1...@gmail.com> wrote: > Hello, > > sure thing you can put that in app_controller, so that you do not have > to re-write it all over. > > If you are using findAll(); for all pages, you should consider > caching, that really makes the job really good. > > Cheers, > Faifas > > On Wed, Feb 25, 2009 at 13:59, simon...@terra.com.br > > <simon...@terra.com.br> wrote: > > > Good Morning, > > > I have like 20 pages on my site and they all use these: > > > $menu = $this->Grupo->findAll(null,null, array("Grupo.grupo > > ASC")); > > $this->set('menu', $menu ); > > > $submenu = $this->Linha->findAll(null,null, > > array("Linha.linha > > ASC")); > > $this->set('submenu', $submenu ); > > > Now I'm putting them in every controller and I also put those two > > models: > > > var $uses = array('Linha','Grupo'); > > > Can I put this in the app_controller.php file or somewhere else, > > instead of repeating this in every file? > > > Regards, --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---