would only be appropriate in cakephp 1.3! (in the view)
On 24 Dez., 12:40, stefano <ssalvat...@gmail.com> wrote:
> if($Session->read("User.id")) {
> ...
>
> }
>
> On Thu, Dec 24, 2009 at 8:30 AM, Edinei Luis Cipriani
>
>
>
> <phpedi...@gmail.com> wrote:
> > If(isset($this->Session->read('User.id'))):
> >> echo $html->link('Logout', array('controller' => 'Users',
> >> 'action'=>'logout'));
>
> > endif;
>
> > happy christmas
>
> > Em 24/12/2009, às 07:46, emmexx escreveu:
>
> >> I'd like to put a logout link in my default layout. The link should be
> >> there only when a user has already logged in.
> >> I put the following code in my app/views/layouts/default.ctp:
>
> >> if ($this->Auth->user())
> >> echo $html->link('Logout', array('controller' => 'Users',
> >> 'action'=>'logout'));
>
> >> but, of course, cake didn't like and screamed in horror:
>
> >> Notice (8): Undefined property: View::$Auth [APP/views/elements/
> >> logout.ctp, line 3]
>
> >> Fatal error: Call to a member function user() on a non-object in /app/
> >> views/elements/logout.ctp on line 3
>
> >> Is there a way to accomplish that?
>
> >> Thank you and Merry Christmas!
>
> >> maxx
>
> >> 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+unsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en
>
> --
> Stefano Salvatori M.http://stefano.salvatori.cl/
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment