Ejemplo n.º 1
0
 /**
  * (non-PHPdoc)
  * @see Zend_Controller_Action::init()
  */
 public function init()
 {
     parent::init();
     // Load the module, controller and action names
     $this->view->module_name = $this->_moduleName = ucfirst($this->getRequest()->getModuleName());
     $this->view->controller_name = $this->_controllerName = ucfirst($this->getRequest()->getControllerName());
     $this->view->action_name = $this->_actionName = ucfirst($this->getRequest()->getActionName());
     // Load the translation name
     $this->view->translation_name = $this->_translationName = $this->_moduleName . $this->_controllerName . $this->_actionName;
     // Load the log
     $this->_log = $this->getInvokeArg('bootstrap')->log;
     // Load the flashmessenger
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
     $this->view->messages = $this->_flashMessenger->getMessages();
     // Load the user
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $this->_user = $auth->getIdentity();
         if ($this->_user->isConnected()) {
             $this->_user->connect();
         }
     }
 }