Answer the question
In order to leave comments, you need to log in
How to use behaviors in Yii2 to update date?
For example, there is a blog module and we are creating a new post. The entry has a creation date, as I understand it, earlier in Yii1 it was written in afterAction, but now in behaviors, or what?
Can you please tell me how in Yii2 you can add the date of creation or update of a record?
Answer the question
In order to leave comments, you need to log in
Yii2 has TimestampBehavior. Inside is an example of usage.
https://github.com/yiisoft/yii2/blob/master/framew...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question