/** * Removes the selected student. * @access public * @return void */ public function studentsDeleteAction() { if ($this->loginStatus) { if (isset($this->post_data['id'])) { $studDelModelObj = new StudentsDeleteModel(); $studDelModelObj->deleteStudent($this->post_data['id']); } $studListControllerObj = new StudentsListController(); $studListControllerObj->studentsListAction(); } else { $out = LoginPleaseView::getLoginMessage(); $this->printIndexPage($out); } }
/** * Generate controllerName, controllerAction and arguments * @access public * @return void */ public function init() { $route = array(); $query = $this->request->getQuery(); $route['controllerName'] = '\\controllers\\' . ucfirst($query[0]) . 'Controller'; $route['controllerAction'] = $query[1] . 'Action'; $route['actionArgs'] = $this->request->getArgs(); if (file_exists(ROOT . $route['controllerName'] . '.php')) { $controllerObj = new $route['controllerName'](); call_user_func_array(array($controllerObj, $route['controllerAction']), $route['actionArgs']); } else { $studListControllerObj = new StudentsListController(); $studListControllerObj->studentsListAction(); } }