/** * Creates a new PageCategory model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new PageCategory(); if ($model->load(Yii::$app->request->post()) && $model->save()) { Yii::$app->session->setFlash('success', Yii::t('app', 'Saved')); return $this->redirect(['index']); } else { return $this->render('create', ['model' => $model]); } }
public function actionCreate() { $model = new PageCategory(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['index']); } else { $locals = []; $locals['model'] = $model; return $this->render('create', $locals); } }