I had a similar problem (display the logged in username in the
default.ctp header), and used the beforeFilter function in the
app_controller. This is a function that when defined in a controller
will execute before any controller action, so if you place it in
app_controller.php the same code will execute before any action in any
controllers and you can do your $this->set() there to setup your list
for the default.ctp view.

A word of caution, if you define beforeFilter in a normal controller.
be sure to call:
parent::beforeFilter();
so that the app_controller beforeFIlter executes.


On Apr 22, 10:58 am, blake <blake.jor...@gmail.com> wrote:
> Hello,
>
> I have a menu being generated in my default.ctp file, and I need the
> menu options to change depending on a users permissions. I have a
> component to handle all the checking and returning an array I can use,
> but I am unsure how to properly get that data into the default.ctp
> layout.
>
> What controller would I use the component in to pass the data through
> to default.ctp?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to