CodeIgniter-MY_Model
CodeIgniter-MY_Model copied to clipboard
Handle a form validation error in observers(before_*) functions?
Hi,
Question is how can i handle/declare an error in before_create function then skip inserting database and return to the form without loosing $post data?
Thanks.
Maybe we need to add FALSE control like below(?). This solves my problem for going to the form without losing post data at least.
418: $data = $this->trigger('before_create',$data); if($data !== FALSE && $this->_database->insert($this->table, $data))
Also for other observers?