From 199873360a41696540cee2685d0d2d298fc5ef07 Mon Sep 17 00:00:00 2001 From: xamgore <xamgore@ya.ru> Date: Wed, 11 Mar 2015 18:22:27 +0300 Subject: [PATCH] The undefined variable warning suppressed --- .../classes/Controller/Handler/AdmStudents.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/~dev_rating/application/classes/Controller/Handler/AdmStudents.php b/~dev_rating/application/classes/Controller/Handler/AdmStudents.php index 9fa1b32f6..aad97a681 100644 --- a/~dev_rating/application/classes/Controller/Handler/AdmStudents.php +++ b/~dev_rating/application/classes/Controller/Handler/AdmStudents.php @@ -1,6 +1,6 @@ <?php defined('SYSPATH') or die('No direct script access.'); -class SortingOptions { //extends SplEnum { +abstract class SortingOptions { //extends SplEnum { // todo: think about usage & file system //const __default = self::Name; const Name = 0; @@ -117,6 +117,8 @@ class Controller_Handler_AdmStudents extends Controller_Handler { public function action_getStudentsList($option = SortingOptions::Name) { + $twig = Twig::factory('admin/students/handler/listOutput'); + $success = false; $facultyID = $this->post->offsetGet('facultyID'); $gradeID = $this->post->offsetGet('gradeID'); @@ -128,17 +130,17 @@ class Controller_Handler_AdmStudents extends Controller_Handler { -> rule('gradeID', 'digit') -> rule('GroupID', 'not_empty') -> rule('groupID', 'digit'); + if($this->post->check()) { // $result = $this->commonModel->GetStudentsList($this->user['UserID'], $facultyID , $gradeID, $groupID); $result = Model_Students::create()->byFaculty($facultyID , $gradeID, $groupID)->asArray(); if (!empty($result)) { + $twig->List = $result; $success = true; } } //$this->response->body(json_encode($data)); - $twig = Twig::factory('admin/students/handler/listOutput'); - $twig->List = $result; $twig->Success = $success; $this->response->body($twig); } -- GitLab