Codeigniter custom validation rules in model |
@dbui
I use the same approach, a callback wrapper within the controller with a tiny difference (tried on CI3): Code: $this->form_validation->set_rules('email', "email",'callback_validate_user'); In my code it would be: Code: $this->form_validation->set_rules('email', "email",'callback__validate_user'); And: Code: public function validate_user($str) { would be: Code: public function _validate_user($str) { Ugly a little bit, but this prefixed with "_" callback rule can not be called by the router. |
Messages In This Thread |
Codeigniter custom validation rules in model - by yatinmistry5130 - 01-09-2015, 04:59 AM
RE: Codeigniter custom validation rules in model - by kilishan - 01-09-2015, 09:14 AM
RE: Codeigniter custom validation rules in model - by Narf - 01-09-2015, 10:39 AM
RE: Codeigniter custom validation rules in model - by dbui - 01-09-2015, 11:56 AM
RE: Codeigniter custom validation rules in model - by ivantcholakov - 01-09-2015, 12:45 PM
|