public function actionSaveEmail() { $model = new EmailForm(); if ($model->load(Yii::$app->request->post()) && $model->update()) { return $this->redirect(['default/index']); } }
public function actionIndex() { $model = new EmailForm(); if ($model->load(Yii::$app->request->post()) && $model->update()) { return $this->redirect(['index']); } else { return $this->render('index', ['model' => $model]); } }