Exemplo n.º 1
0
 /**
  * Creates a new AuthItem model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Route();
     if ($model->load(Yii::$app->getRequest()->post())) {
         if ($model->validate()) {
             $routes = preg_split('/\\s*,\\s*/', trim($model->route), -1, PREG_SPLIT_NO_EMPTY);
             $this->saveNew($routes);
             MenuHelper::invalidate();
             $this->redirect(['index']);
         }
     }
     return $this->render('create', ['model' => $model]);
 }