Zend Framework Source Code Snippets

UserIdentity view helper

Bookmark and Share
1
2
3
4
56
7
8
9
1011
12
13
14
1516
17
18
19
<?php
/**
 * UserIdentity view helper
 * 
 * @author     Balazs Varkonyi <varkonyi.balazs@linuxforge.hu> * @copyright  2008, Balazs Varkonyi
 **/
 
class App_View_Helper_UserIdentity {
                function userIdentity() {               
                if (!Zend_Auth::getInstance()->hasIdentity()) {
                        return false;
                }
                return Zend_Auth::getInstance()->getIdentity();        }
        
}
?>

Comments

Pacek Pacek
2 years ago

Nice and simple. Up.

Court Ewing Court Ewing
2 years ago

This is a simple, helpful concept, but supporting more authentication methods than simply Zend_Auth would be much more in the spirit of the entire framework.

bachya bachya
2 years ago

Nice work, thank you.

You must login before commenting on a snippet. If you do not have an account, please register.

Snippet description

A pretty simple but frequently used view helper for getting user identity.

Snippet details

Created:
vbali vbali
2 years ago
Edited:
vbali vbali
2 years ago
Revision Id:
32
Edit Message:
Initial Release
Tags:
helper user identity
Comments:
3
Views:
1232
Points:
1 (1 votes)

History

r32

Initial Release

vbali vbali
2 years ago