that's the same way i'm doing right now.

unfortunately my layout is shared across 3 apps and, the other 2,
doesn't have authentication.
this selection must be done in any controller callback, but not in the
layout :\

can the controller read an html file and assign his content to a wiev
variable?

some sort of $this->set("leftbar_for_layout", $this->readThisFile("/
element/". $this->getGroupName($this->Auth-
>user("group_id")) ."_menu"));

On 18 Mag, 15:20, Brenda <rld0...@gmail.com> wrote:
> You can read the info you set during Auth in the view. In my case, I
> have a variable Auth.User.is_admin, which I then read like this at the
> top of the default layout, default.ctp
>
> $isAdmin = $session->read('Auth.User.is_admin');
>
> Then later in the view, I determine whether or not to show the admin
> elements or just the user elements:
>
> if ($isAdmin) {
>     echo $this->element(... admin version ...);} else {
>
>     echo $this->element(... user version ...);
>
> }
>
> ...Brenda
>
> On May 18, 8:10 am, Ernesto <e.fanz...@gmail.com> wrote:
>
>
>
>
>
> > Hello.
>
> > i have 3 elements "standard_leftbar", "admin_leftbar" and
> > "customer_leftbar".
>
> > is there any smart way to render one of those elements in my view,
> > based on User's group_id, provided by the Auth component?
>
> > sry for my bad english
>
> > bye
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> > with their CakePHP related questions.
>
> > 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 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> 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 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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