public function before_add() {
//assuming our datetime field is called 'entry_datetime'
$this->model->set_db_param_type( 'entry_datetime', 'function' ); //tell the model that we don't want a literal 'NOW()' inserted
$this->model->entry_datetime = 'NOW()';
}
You can also add the same code to before_edit() if you need the same functionality when editing
No comments:
Post a Comment