Problems with extending CI_Form_validation |
Regarding problem #1, everything looked OK to me the way you handled it in the beginning, except how you refer to the callback function.
Try: PHP Code: $this->form_validation->set_rules('email', '', 'callback_scanEmail'); The function itself should keep the name 'scanEmail'.
That approach will only look for the method scanEmail in the controller where the rule was set.
If you extend a core library by using the MY_ prefix, the extended library is loaded with the original name. So there is no need for changing your controllers or models.
When you load the Form_validation library, CI will first check if there is a MY_Form_validation.php in application/libraries. If that isn't the case, it will load the core library from system/libraries. |
Welcome Guest, Not a member yet? Register Sign In |