示例#1
0
 /**
  * Создание правила
  * @return string|\yii\web\Response
  */
 public function actionCreate()
 {
     $model = new AuthRule();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         Yii::$app->getSession()->setFlash('success', Yii::t('user', 'Правило контроля доступа создано.'));
         return $this->redirect(['view', 'id' => $model->name]);
     } else {
         return $this->render('@vendor/lowbase/yii2-user/views/auth-rule/create', ['model' => $model]);
     }
 }