public function action_create() { if (Input::method() == 'POST') { $val = Model_News_Category::validate('create'); if ($val->run()) { $news_category = Model_News_Category::forge(array('name' => Input::post('name'))); if ($news_category and $news_category->save()) { Session::set_flash('success', 'Added news_category #' . $news_category->id . '.'); Response::redirect('news/category'); } else { Session::set_flash('error', 'Could not save news_category.'); } } else { Session::set_flash('error', $val->error()); } } $this->template->title = "News_Categories"; $this->template->content = View::forge('news/category/create'); }