芝麻web文件管理V1.00
编辑当前文件:/home/p/r/i/prismawe/www/resupres/application/classes/controller/admin/partis.php
order_by('nom', 'ASC') ->find_all(); $this->template->content = View::factory('admin/partis/list'); $this->template->content->partis = $partis; } public function action_new(){ $orientations = ORM::factory('orientation') ->order_by('nom', 'ASC') ->find_all(); $this->template->content = View::factory('admin/partis/new'); $this->template->content->orientations = $orientations; } public function action_newPost(){ $parti = ORM::factory('parti'); $parti->nom = $this->request->post('nom'); $parti->wiki = $this->request->post('wiki'); $parti->dateCreation = $this->request->post('dateCreation'); $parti->orientation_id = $this->request->post('orientation_id'); $parti->description = $this->request->post('description'); $parti->save(); $this->request->redirect('admin/partis'); } public function action_modify(){ $parti = ORM::factory('parti', $this->request->param('id')); if ($parti->loaded()){ $orientations = ORM::factory('orientation') ->order_by('nom', 'ASC') ->find_all(); $this->template->content = View::factory('admin/partis/modify'); $this->template->content->parti = $parti; $this->template->content->orientations = $orientations; } else $this->request->redirect('admin/partis'); } public function action_modifyPost(){ $parti = ORM::factory('parti', $this->request->param('id')); if ($parti->loaded()){ $parti->nom = $this->request->post('nom'); $parti->wiki = $this->request->post('wiki'); $parti->dateCreation = $this->request->post('dateCreation'); $parti->orientation_id = $this->request->post('orientation_id'); $parti->description = $this->request->post('description'); $parti->save(); } $this->request->redirect('admin/partis'); } }