开发者

how to get currently logged user details zend framework

开发者 https://www.devze.com 2023-03-02 03:02 出处:网络
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:

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

精彩评论

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