Why not ? Понеділок, 12 листопада 2012 р. 12:03:59 UTC+2 користувач euromark написав: > > don't access the session array directly > use $this->Session->read() via component or helper > > > Am Montag, 12. November 2012 10:41:54 UTC+1 schrieb SCOFIELD_UA: >> >> If you use CakePHP, then the right way is to use >> AuthComponent::loggedIn()<http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#AuthComponent::loggedIn> >> To display user name use >> $this->Auth->user('username');<http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#AuthComponent::user> >> >> If you use native PHP: >> >> if(!isset($_SESSION['username'])) { >> echo "Why you dont register ?"; >> } else { >> echo $_SESSION['username']; >> } >> >> or >> >> echo !isset($_SESSION['username']) ? "Why you dont register ?" >> : $_SESSION['username']; >> >
-- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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]. Visit this group at http://groups.google.com/group/cake-php?hl=en.
