/ Published in: PHP

Ruby uses created_at and updated_at. Here cake will do the same thing.
based on http://book.cakephp.org/view/1015/created-and-modified
based on http://book.cakephp.org/view/1015/created-and-modified
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php class AppModel extends Model { // set created_at field before creation $data[$this->name]['created_at'] = $now; } // set updated_at field value before each save $data[$this->name]['updated_at'] = $now; return parent::save($data, $validate, $fieldList); } }
Comments
