Example #1
0
 /**
  * Creates a new ParserAlias model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new ParserAlias();
     $model->category = Yii::$app->request->get('category');
     $model->name = Yii::$app->request->get('name');
     $model->id = Yii::$app->request->get('id');
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['/alias', 'id' => $model->name]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }