A
A
Alexander Valinurov2015-06-17 22:21:25
Yii
Alexander Valinurov, 2015-06-17 22:21:25

How to save search form attributes?

Hey!
Is there an option in yii2 to save form values ​​out of the box?
A little more. I am a user of the site, I am searching the database for information by filling out a form. Found, went to another page, and returned. And I want to see on the form those search queries that I asked earlier, and not reset.
On bare php, I did this just in sessions. Saved the completed form fields in the session. Does yii2 have something out of the box, or is it a snippet that everyone knows about?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Bay, 2015-06-18
@kawabanga

But doesn't the form with the GET method solve the problem?
For example
<?= Html::textInput('findinput', $_GET['findinput']) ?>

M
Maxim Mironyuk, 2015-06-23
@serieznyi

As far as I know, there is no such functionality out of the box.
You just have to write everything yourself using cookies or localStorage.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question