Esempio n. 1
0
 public function action_delete($name)
 {
     if (!($data['page'] = Model_Page::get_by_title($name))) {
         throw new HttpNotFoundException();
     }
     if (Input::post('submit')) {
         if ($data['page']->purge()) {
             Session::set_flash('success', 'Deleted page');
             Response::redirect('');
         } else {
             Session::set_flash('error', 'Could not delete page');
         }
     }
     $this->template->title = $name;
     $this->template->name = $name;
     $this->template->content = View::forge('page/delete', $data);
 }