I have a Zend Application with user authentication. I need the UserID in nearly every action for database queries. Certainly I want to have quick access primarily in controllers but also in view scripts.
The way I get so far:
Zend_Auth::getInstance()->getIdentity()->User_ID
How can I write a plugin or helper to provide the UserID in an easier way?
e.g. like this:
$this->User_ID
you can make property in your controller which could be set in controller constructor:
or drop it to
Zend_Registrywhen establish and use from there.