Answer the question
In order to leave comments, you need to log in
How to set Yii2 to automatically save date_create and last_status_change in a form?
There is a feedback form. There are date_create and last_status_change fields. How to make form creation data and form changes automatically saved?
It looks like this. A person visits the page with the form and writes a review. Presses the send button. At this time, something happens in the model and the values \u200b\u200bof the date of creation and the last modification are written to my database.
Answer the question
In order to leave comments, you need to log in
https://github.com/yiisoft/yii2/blob/master/docs/g...
Using TimestampBehavior.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question