Extend MY_Form_validation not work |
I'm locked for extend my form_validation rules...
In my controller I have a function article_new() who have this rules : PHP Code: $this->form_validation Here my function handle_upload : PHP Code: <?php My function works well but I want to move this out of my controller. So I put the function in the MY_Form_validation library located in application/librairies/MY_Form_validation.php. If I do this, and I remove "callback_" in my rules it doesn't work... and I don't know why ![]() I work with the 2.2.6 version.
You are not showing us your MY_Form_validation.php...
Website: http://avenir.ro
Thanks for your reply !
I have that in MY_Form_validation file ( in application/libraries/ ) : PHP Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
In your rule set_rules('image','Image','callback_handle_upload') you need to remove the callback_ from the function call.
Hope that helps, Paul. (07-18-2016, 07:32 AM)PaulD Wrote: In your rule set_rules('image','Image','callback_handle_upload') you need to remove the callback_ from the function call. Thanks for your answer, but I said in my first message that I remove the "callback_" in my rules when I put my function in MY_Form_validation file and it's why I don't understand what I missed ...
1. STOP USING CI2!
2. Pay attention to context. $this->form_validation inside doesn't exist, it needs to be just $this. |
Welcome Guest, Not a member yet? Register Sign In |