yII Behaviour Tutorials

Timestamp Behavior In Yii

Normally we will add some fields in every table of application database. Ex createdby, createdon, modifiedby, modifiedon, lasteditedby, lasteditedon etcSo we have to configure model for this action. Normally we will add beforeSave() method in every model. Instead of beforeSave in every model, We will create one behavior class and add this beforeSave method. Now we can include this behavior to every model.Create Timestamp BehaviorAdd Timestamp To ModelCreate Timestamp BehaviorI […]... Read More »