Пример #1
0
 /**
  * "Флиьтр" по месяцу рождения студенов
  * @return string
  */
 public function actionStudentfilter()
 {
     $month = Yii::$app->getRequest()->getQueryParam('month', self::DEFAULT_STUDENT_BORN_MONTH);
     if ($month < 1 || $month > 12) {
         $month = self::DEFAULT_STUDENT_BORN_MONTH;
     }
     $monthes = array(1 => 'Январь', 2 => 'Февраль', 3 => 'Март', 4 => 'Апрель', 5 => 'Май', 6 => 'Июнь', 7 => 'Июль', 8 => 'Август', 9 => 'Сентябрь', 10 => 'Октябрь', 11 => 'Ноябрь', 12 => 'Декабрь');
     $model = new Teacher();
     $dataProvider = $model->findWhoAllStudentsBornInMonth($month);
     $dataProvider->setPagination(false);
     $this->view->title = 'Список учителей, все ученики которых рождены в месяце "' . $monthes[$month] . '"';
     return $this->render('index', ['showMonthFilter' => true, 'monthes' => $monthes, 'dataProvider' => $dataProvider]);
 }