/** * Управление Комнатам. * * @return void */ public function actionIndex() { $model = new Room('search'); $model->unsetAttributes(); // clear any default values if (Yii::app()->getRequest()->getParam('Room') !== null) { $model->setAttributes(Yii::app()->getRequest()->getParam('Room')); } $this->render('index', ['model' => $model]); }
/** * Управление Аудиториями. * * @return void */ public function actionIndex() { $roles = ['1']; $role = \Yii::app()->user->role; if (array_intersect($role, $roles)) { $model = new Room('search'); $model->unsetAttributes(); // clear any default values if (Yii::app()->getRequest()->getParam('Room') !== null) { $model->setAttributes(Yii::app()->getRequest()->getParam('Room')); } $this->render('index', ['model' => $model]); } else { throw new CHttpException(403, 'Ошибка прав доступа.'); } }