コード例 #1
0
ファイル: Dashboard.php プロジェクト: alextoshinov/musyme
 public function action_editAgegroup()
 {
     $id = $this->request->param('id');
     $this->template->show_logout = TRUE;
     $this->template->title = 'Age group::Edit';
     $agegroup = Model_Agegroup::getAgegroupById($id);
     $view = $this->template->content = View::factory('dashboard/agegroup/edit')->set('agegroup', $agegroup);
     if ($this->request->method() == Request::POST) {
         //
         $ageArr = array('title' => $_POST['title'], 'description' => $_POST['description'], 'is_public' => $_POST['is_public']);
         //
         Model_Agegroup::editAgegroup($ageArr, $_POST['id']);
         //
         if ($_POST['id']) {
             $this->redirect('dashboard/editagegroup/' . $_POST['id']);
         }
     }
     $this->response->body($view);
 }