การใช้ CTimestampBehavior
public function behaviors(){
return array(
'CTimestampBehavior' => array(
'class' => 'zii.behaviors.CTimestampBehavior',
'createAttribute' => 'create_time_attribute',
'updateAttribute' => 'update_time_attribute',
)
);
}
create_time_attribute เป็น field ในตาราง DB ถ้าไม่มีให้ใช้ NULL

0 ความคิดเห็น:
แสดงความคิดเห็น