/** * Creates a new CmsModel model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new CmsModel(); if ($model->load(Yii::$app->request->post()) && $model->save()) { Yii::$app->session->setFlash('success', App::t('yii2mod', 'Page has been created.')); return $this->redirect(['index']); } return $this->render($this->viewPath . 'create', ['model' => $model]); }
/** * Creates a new CmsModel model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new CmsModel(); if ($model->load(Yii::$app->request->post()) && $model->save()) { Yii::$app->session->setFlash('success', 'Page has been created.'); return $this->redirect(['index']); } return $this->render('@vendor/yii2mod/yii2-cms/views/cms/create', ['model' => $model]); }