widgets\ActiveForm $method

$method public property

The form submission method. This should be either post or get. Defaults to post.

When you set this to get you may see the url parameters repeated on each request. This is because the default value of $action is set to be the current request url and each submit will add new parameters instead of replacing existing ones. You may set $action explicitly to avoid this:

$form = ActiveForm::begin([
    'method' => 'get',
    'action' => ['controller/action'],
]);
public string $method = 'post'
doc_Yii
2016-10-30 17:18:00
Comments
Leave a Comment

Please login to continue.