P
P
prozrost2017-02-16 21:46:54
Yii
prozrost, 2017-02-16 21:46:54

How to change direction of POST request?

I have a form that submits some data. But according to yii2 debugger it sends them here:
localhost/basic/web/index.php
How can I make this POST be processed in another action in my controller?
For example, there is such action^

public function actionForm()
{
     $Form = new Form();
     if ($Form->load(Yii::$app->request->post('Form')) && $Form->save()) {
                 return 'ok';
             } else {
                 return 'false';
             }

}

How can this be implemented?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2017-02-17
@slo_nik

Good evening.
The web contains the input script, nothing will be sent to it. And you have web in the address, most likely due to the fact that you did not configure the urlManager to the end of the path.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question