public function commit() { $app = \Slim\Slim::getInstance(); $params = $app->request->params(); $error_list = V_Post::byArray($params); if (empty($error_list)) { $post = new M_Post(); $post->nickname = $params['nickname']; $post->body = $params['body']; $post->save(); $app->redirect('/'); } else { $app->render('Post/form.twig', ['params' => $params, 'error_list' => $error_list]); } }
private function _testOnlyBody($body) { $input = ['nickname' => 'oknickname', 'body' => $body]; return V_Post::byArray($input); }