You can extend your app_controller and put this method inside the
beforeRender() function. That way, it gets executed before the page
is output. This way, you just right it once and all of your views
have access to the data.
On May 22, 4:24 pm, hostdesigner <[EMAIL PROTECTED]> wrote:
> I created one controller with name CategoriasController and it have
> the method menu() is responsible for create the menu of page, but, how
> execute this method in all pages?
>
> OBS.: Can'not use directly in the layout of default.thtml page
>
> This is the method menu
>
> // EXIBE O MENU
> function menu(){
>
> // SELECIONA TODAS AS CATEGORIAS RAIZ
> $conditions = array("subCategoria" => "0");
> //$this -> set("dadosMenu", $this -> Categoria ->
> read());
>
> $this -> set("dadosMenu", $this -> Categoria ->
> findAllBy("Categoria.subCategoria = '0'")); // findBysubCategoria = 0
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---