Beispiel #1
0
 public function indexAction()
 {
     $category_id = Comm\Arg::post('category_id');
     $title = Comm\Arg::post('title');
     $content = Comm\Arg::post('content');
     Model\Article::create($category_id, $title, $content);
     Comm\Response::json(100000, '发表成功', ['href' => Comm\View::path('manage/article/index')], false);
 }
Beispiel #2
0
 /**
  * 以网页形式处理异常
  * 
  * @param Exception $exception
  */
 protected function _html(Exception $exception)
 {
     if ($exception instanceof ErrorException) {
         //系统错误
         if (!\Comm\Misc::isProEnv()) {
             $this->_debugHtml($exception);
         }
     } elseif ($exception instanceof \Exception\Nologin) {
         //用户未登录
         header('Location:' . Comm\View::path('user/github/login'));
     } elseif ($exception instanceof \Exception\Program) {
         //程序错误
         $this->viewDisplay(array('exception' => $exception), 'error/error');
     } else {
         //其它异常
         $this->viewDisplay(array('exception' => $exception), 'error/error');
     }
 }
Beispiel #3
0
 public function indexAction()
 {
     $categorys = Model\Category::showUserAll();
     $this->viewDisplay(array('form_action' => Comm\View::path('aj/manage/article/create'), 'categorys' => $categorys), 'manage/article/update');
 }
Beispiel #4
0
 public function indexAction()
 {
     session_destroy();
     return $this->redirect(Comm\View::path(''));
 }