Hi all,
i'm learning with zend framework and mvc architecture... and it's hard
for me :-)
Beause i want it for each controller in my app i made a plugin wich
purpose is to test if user is authenticated. I would like it, if true,
to pass the info to the view but it does not work, even i user is
authenticated, my view var is null. I suppose it's because the view
objetc is not yet initialised when the plugin is executed but i can't
see where or when to do this.
Here is my plugin :
class AuthPlugin extends Zend_Controller_Plugin_Abstract {
public function preDispatch(Zend_Controller_Request_Abstract $request) {
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$this->view->user = $auth->getIdentity();
}
}
}
thanks for help
--
Denis