Example #1
0
 /**
  * 初始化
  */
 protected function initialize()
 {
     parent::initialize();
     //Prepend the application name to the title
     \Phalcon\Tag::prependTitle('Blog | ');
     $this->view->setTemplateAfter('common');
 }
Example #2
0
 /**
  * @param unknown $dispatcher
  */
 public function beforeExecuteRoute($dispatcher)
 {
     $public_controller = array('index');
     parent::beforeExecuteRoute($dispatcher);
     if ($this->checkIsLogin()) {
         $this->user = $this->session->get('user');
     } else {
         if (!in_array($this->controller, $public_controller)) {
             $this->response->redirect('/login', true);
         }
     }
 }
Example #3
0
 /**
  * 初始化
  */
 protected function initialize()
 {
     parent::initialize();
     //Prepend the application name to the title
     \Phalcon\Tag::prependTitle('Blog | ');
     if ($this->checkIsLogin()) {
         $this->admin = $this->session->get('admin');
     } else {
         $this->response->redirect('/login', true);
     }
     $this->view->setTemplateAfter('common');
 }