public function delete() { $this->verify_id_param(); $this->set_object(); if (!empty($this->object)) { $this->model->delete($this->params['id']); $this->flash('notice', 'Successfully deleted!'); } else { $this->flash('warning', 'A ' . MvcInflector::humanize($this->model->name) . ' with ID "' . $this->params['id'] . '" couldn\'t be found.'); } $url = MvcRouter::admin_url(array('controller' => $this->name, 'action' => 'index')); $this->redirect($url); }