public function onDispatch(MvcEvent $e)
 {
     $this->layout('layout/login_register');
     /** INSTANTIATE FLASH MESSENGER **/
     $this->flashMessenger = $this->flashMessenger();
     return parent::onDispatch($e);
 }
 public function onDispatch(MvcEvent $e)
 {
     //        $action = $this->params('action');
     //
     //        if (!$this->_hasIdentity() && ($action != 'login') && !in_array($action, $this->publicActions))
     //        {
     //            return $this->redirect()->toRoute(static::ROUTE_LOGIN);
     //        }
     $this->layout('layout/dashboard');
     /** INSTANTIATE FLASH MESSENGER **/
     $this->flashMessenger = $this->flashMessenger();
     return parent::onDispatch($e);
 }