views:

25

answers:

1

Hi, I'm new to Zend and not sure on how to go about this problem:

After a user logs in and gets authenticated, I make a query and retrieve the user's roles. From what I understood, a Zend_Registry variable is only global if it is set inside the bootstrap. Is it possible to create a global variable inside the controller?

+1  A: 

Zend_Registry is a container, and you can put stuff into it whenever you want. But obviously you have to put data into it before being able to pull from it (in a request life-cycle that is).

Though if you're using Zend_Auth and it's Database adapter (Zend_Auth_Adapter_DbTable), you can simply put user row in session.

racetrack