public function actionAdd()
 {
     $model = new Article();
     if (Request::isPost()) {
         if ($model->add(['title' => Request::post('title'), 'content' => Request::post('content')])) {
             Redirect::home();
         }
     }
     echo $this->view->render('add');
 }
Esempio n. 2
0
 private function signIn()
 {
     Mysql::connect();
     $this->email = Request::post('email', '');
     $this->password = Request::post('password', '');
     if (User::signIn($this->email, $this->password)) {
         Response::redirect('/');
     } else {
         $this->error = 'wrong';
     }
     return false;
 }