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