As Luke already pointed out, to prepare any kind of variable / data
for your views, you need to use the Controller::set() method.

Declaring a variable is not enough because it is only a local var
then, isn't it? Besides, if you view could see every single variable
from your controller, that wouldn't be very clean, right? :)

Also, since this is a very basic question, you might want to take a
look at the blog tutorial in the cookbook.

On May 21, 12:57 pm, lakers fan <[email protected]> wrote:
> Hello,
>
>     I want to create a variable and initialize it in say AppController in 
> beforeFilter() and use the variable in the view (ctp file). I created a 
> variable $admin = false and tried to use it in view and I get error saying 
> $admin is undeclared variable. Is there any other way of doing this?
>
> Thanks,
>
> Bharani
>
> _________________________________________________________________
> Hotmail® has a new way to see what's up with your 
> friends.http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM...
--~--~---------~--~----~------------~-------~--~----~
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