use $session->check(), which returns true/false if the given key exists.
On Jun 8, 4:58 pm, cakephp_rocks <[email protected]> wrote: > [Auth] => Array > ( > [User] => Array > ( > [id] => 15 > [username] => xxx > [email] => [email protected] > [group] => xxxx > [auth_token] => > [email_verified] => 1 > [email_token] => > [email_token_expires] => > [first_name] => xxxx > [last_name] => xxxx > [created] => 2008-11-10 12:33:50 > [modified] => 2008-11-10 14:19:11 > ) > > ) > > you mean this > > is there any other sloution to do thats what i did > > <?php if (empty($session->read('Auth.User'))) { > > echo $html->link(__('login to comment', true), 'users/login'); > > } > > ?> > thats what i want when a user not login it should be link in that view > to take them to login and comment > is there any other way to that > > Thanks in advance > > On Jun 8, 1:37 pm, Miles J <[email protected]> wrote: > > > Try debugging the session in the view: > > > debug($session->read('Auth')); > > > See if the User array exists. > > > On Jun 8, 10:55 am, cakephp_rocks <[email protected]> wrote: > > > > hey this didnt work i want to used it in my view when i put this i get > > > this fatel error > > > > Fatal error: Can't use function return value in write context in C: > > > \xampp\htdocs\mycake\app\views\post\view.ctp on line 37 > > > > On Jun 5, 1:24 pm, Miles J <[email protected]> wrote: > > > > > if (empty($session->read('Auth.User'))) { > > > > > } > > > > > On Jun 5, 9:03 am, cakephp_rocks <[email protected]> wrote: > > > > > > how can you use this if ($loggedIn == 0){ > > > > > > to set message like lets say > > > > > > i have comment box if users not logged in show them this message > > > > > > (login to comment )- Hide quoted text - > > > > > - Show quoted text -- Hide quoted text - > > > - Show quoted text - > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
