/** * Creates a new Forum model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Forum(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }
/** * Creates a new Forum model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $this->layout = '@app/modules/user/views/layouts/user'; $model = new Forum(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->forum_url]); } else { return $this->render('create', ['model' => $model]); } }
/** * Creates a new Forum model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $this->layout = '@app/modules/user/views/layouts/user'; $model = new Forum(); if ($model->load(Yii::$app->request->post()) && $model->save()) { Yii::$app->getSession()->setFlash('success', Yii::t('app', 'Create successfully.')); return $this->redirect(['view', 'id' => $model->forum_url]); } else { return $this->render('create', ['model' => $model]); } }