Difference between #10 and #11 of
How to automate timestamps in ActiveRecord models

Revision #11 has been created by Narretz on Apr 4, 2012, 4:11:57 PM with the memo:

I added a reference to the CTimestampBehavior as a third possibility.
« previous (#10) next (#12) »

Changes

Title unchanged

How to automate timestamps in ActiveRecord models

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

Content changed

There are many ways to automate the setting of timestamps in yii ActiveRecord models. Two of them ahree are presented here: 1. Via rules() 2. Via beforeSave()  
3. Via CTimestampBehavior (zii)


To start off we need to create a database table.
[...]
These are simple and elegant solutions to this issue.

The third possibility is to use CTimestampBehavior in your models. You can read about this in the API documentation:
 
http://www.yiiframework.com/doc/api/1.1/CTimestampBehavior
 
 
Links ------------------ - [Chinese version](http://www.itkuaixun.com/bbs/thread-197-1-1.html "Chinese version")
25 0
35 followers
Viewed: 154 683 times
Version: 1.1
Category: Tutorials
Tags:
Written by: dalip
Last updated by: Yang He
Created on: Feb 14, 2009
Last updated: 5 years ago
Update Article

Revisions

View all history