/** * @param Request $request * @param Response $response * @return string */ public function index($request, $response) { try { Student::setRegistry($this->registry); $students = Student::findAll(); $response->setParams(array("students" => $students)); return "students"; } catch (ModelException $e) { $response->setParams(array("exception" => $e->getMessage())); $response->sendRedirect("error"); } }