D
D
Daria2017-08-25 17:02:01
Yii
Daria, 2017-08-25 17:02:01

How to place 2 ActiveForm forms on one page that will refer to different actions?

There is a view. It has two forms. I'm trying to write for one:

$form = ActiveForm::begin(['action'=>['/auth/login']]);

For the second:
$form = ActiveForm::begin(['action'=>['/auth/register']]);

Throws a BadRequest error.
Registered in the controller There are no more errors. But how to do it without disabling the csrf token?
public $enableCsrfValidation = false;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-08-25
@webinar

public $enableCsrfValidation = false;

You don't need to remove it, it's protection and not related to the number of forms on the page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question