Change view by userstate
Hello, i want that my login link will be an logout link when a user with this browser is login in. When he is logout the link should show login. And if he is login the link should show logout I tried debug ($session-read()); die; but there is no state variable. Which variable can i use for that feature? many greeting Marcus Radisch --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Change view by userstate
I found the solution I set an username on an variable, and after Logout this variable i set to null :) if(!empty($username)) { echo $html-link('Logout', array ('controller'='users','action'='logout')); } else { echo $html-link('Login', array ('controller'='users','action'='login')); } ? many greetings Marcus Radisch --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Change view by userstate
if you are using the Auth component for user authentification, you can check if a user is logged in or not simply by using: $session-check('Auth.User.id') as a condition in your if clause On Feb 19, 5:19 pm, amarradi radis...@googlemail.com wrote: I found the solution I set an username on an variable, and after Logout this variable i set to null :) if(!empty($username)) { echo $html-link('Logout', array ('controller'='users','action'='logout'));} else { echo $html-link('Login', array ('controller'='users','action'='login'));} ? many greetings Marcus Radisch --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Change view by userstate
Thanks a lot, thats the better way. Marcus Radisch --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---