public function action_newAgegroup() { $this->template->show_logout = TRUE; $this->template->title = 'New age group'; $view = $this->template->content = View::factory('dashboard/agegroup/new'); $error_message = NULL; $pk = FALSE; if ($this->request->method() == Request::POST) { $ageArr = array('title' => $_POST['title'], 'description' => $_POST['description'], 'is_public' => $_POST['is_public']); // $pk = Model_Agegroup::addAgegroup($ageArr); } if ($pk) { $this->redirect('dashboard/editagegroup/' . $pk); } $view->error_message = $error_message; $this->response->body($view); }