public function deleteAction() { $authorization = Zend_Auth::getInstance(); $identity = $authorization->getIdentity(); if ($identity->user_type == "admin") { $id = $this->getRequest()->getParam('id'); if ($id) { $model = new Application_Model_Courses(); $model->deleteCourse($id); } $this->redirect("courses/list"); } else { $this->redirect("cources/index"); } }
public function deleteAction() { $id = $this->getRequest()->getParam('id'); if ($id) { $model = new Application_Model_Courses(); $this->view->courses = $model->deleteCourse($id); } $this->render('list'); }