Wednesday, February 25, 2009

Is there a way to not repeat two "findAll and models" in my site, instead put in just one file?

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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: