Answer the question
In order to leave comments, you need to log in
How to send post request to action in yii2?
Guys, tell me how can I send a Post request to an action from the form on the site?
public function actionForm()
{
$model = new ContactForm();
if ($model->load(Yii::$app->request->post()))
{
$model->contact(Yii::$app->params['adminEmail']);
}
else {
return 'произошла ошибка!!';
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question