开发者

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 !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜