public function actionContact() { $model = new ContactForm(); if ($model->load(Yii::$app->request->post())) { $model->name = $_POST['ContactForm']['name']; $model->message = $_POST['ContactForm']['message']; $model->phone = $_POST['ContactForm']['phone']; if ($model->save()) { Yii::$app->response->redirect(array('site/contact', 'model' => $model)); } return $this->refresh(); } else { return $this->render('contact', ['model' => $model]); } }