Answer the question
In order to leave comments, you need to log in
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
But doesn't the form with the GET method solve the problem?
For example
<?= Html::textInput('findinput', $_GET['findinput']) ?>
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 questionAsk a Question
731 491 924 answers to any question