how to get currently logged user details zend framework
i want to get user details who is logged on开发者_如何学Go to my web site in zend framework .
You can get the data that's stored in Zend_Auth like this:
$identity = Zend_Auth::getInstance()->getIdentity();
The $identity
variable should now contain whatever data you stored into Zend_Auth when logging the user in.
this is part of a function that return usernme detail
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user = $auth->getIdentity();
$username = $this->view->escape(ucfirst($user->username));
}
for another details u can use of $user->otherDetailName
if u save them when user login to site !
精彩评论