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