It is a component and thus only available to cotrollers.
What I do is I set the authentication data I need in my views from the
beforeFilter of AppController.
if ( isset($this->Auth) )
{
// do all the normal auth setups first. Then...
$this->set('auth', $this->Auth->user() );
}
Then I can check if the user is logged in or not. I can print his/her
name in the top-section if I want. Things like that.
You can do the same with Acl stuff.
if ( isset($this->Acl) )
{
$this->set('aclData', $this->Acl->someDataYouNeedOnEveryPage );
}
On Jan 23, 9:02 pm, Keith <[EMAIL PROTECTED]> wrote:
> I'm trying to create a helper that checks the Acl and provides edit /
> delete links appropriately on my index action.
>
> I keep getting an error that Acl is an undefined property in the
> helper. Does the Acl object only exist inside the controller?
>
> Anyone run into this issue and have a work around? I am probably over
> thinking this thing...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---