P
P
Pepper12017-03-14 22:26:02
Yii
Pepper1, 2017-03-14 22:26:02

How to pass GET from YII2 form?

I'm trying to pass from the form by the get method, a string is obtained

http://yii.test/site/seek?Seek[query]=бытовые+услуги&Seek[city]=москва,

but I would like it to be in the usual form
http://yii.test/site/seek?query=бытовые+услуги&city=москва.

By the way, this is how it works in Yii2 with a regular form, without using ActiveForm::, but yii validators are needed

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2017-03-14
@Pepper1

In the Seek model, add:

public function formName()
{
    return '';
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question