From bf2e46f5125f1936ddca26839951b400f3a1d7fd Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Sat, 14 Sep 2013 22:05:08 -0400 Subject: [PATCH] Added a function to delete events. Currently this only allows single events to be deleted. --- web/app/Controller/EventsController.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/app/Controller/EventsController.php b/web/app/Controller/EventsController.php index 5cbd2efc5..80185face 100644 --- a/web/app/Controller/EventsController.php +++ b/web/app/Controller/EventsController.php @@ -60,6 +60,16 @@ public function index() { $this->set('event', $event); } + public function delete($id) { + if ($this->request->is('get')) { + throw new MethodNotAllowedException(); + } + + if ($this->Event->delete($id)) { + return $this->redirect(array('action' => 'index')); + } + } + } ?>