/** * Creates a new KefuSelfservice model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new KefuSelfservice(); $categories = KefuSelfserviceCat::find()->all(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model, 'categories' => $categories]); } }
public function actionBugFanKui() { $model = new KefuSelfservice(); $cat = KefuSelfserviceCat::findOne(['slug' => 'bug-fan-kui']); $model->setAdditional(); if ($model->load(\Yii::$app->request->post()) && $model->save()) { \Yii::$app->session->setFlash('success', '您的建议已成功提交,谢谢您在百忙之中抽出时间给我们建议,我们会尽快处理!'); return $this->redirect(['selfservice-result']); } else { return $this->render('bug-fan-kui', ['model' => $model, 'cat' => $cat]); } }