Esempio n. 1
0
 /**
  *
  */
 public function actionIndex()
 {
     $model = new Type('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Type'])) {
         $model->attributes = $_GET['Type'];
     }
     $this->render('index', ['model' => $model]);
 }
Esempio n. 2
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Type('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Type'])) {
         $model->attributes = $_GET['Type'];
     }
     $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 Type('search');
         $model->unsetAttributes();
         // clear any default values
         if (Yii::app()->getRequest()->getParam('Type') !== null) {
             $model->setAttributes(Yii::app()->getRequest()->getParam('Type'));
         }
         $this->render('index', ['model' => $model]);
     } else {
         throw new CHttpException(403, 'Ошибка прав доступа.');
     }
 }