Welcome Guest, Not a member yet? Register   Sign In
Custom Validation Function
#2

The easiest thing to do is to create that function in a helper, not a library. As long as the helper is loaded, it will be able to find the function just like it can find any PHP command.

A slightly more "proper" way to do it would be to extend the Form_validation library in a MY_Form_validation file. Add the functions to that, and then you should be able to use it like:

Code:
$this->form_validation->set_rules('input', 'lang:', 'trim|required|my_validation' );
Reply


Messages In This Thread
Custom Validation Function - by ardavan - 09-22-2015, 06:28 AM
RE: Custom Validation Function - by kilishan - 09-22-2015, 06:52 AM
RE: Custom Validation Function - by ardavan - 09-24-2015, 06:10 PM
RE: Custom Validation Function - by ardavan - 09-30-2015, 02:15 AM
RE: Custom Validation Function - by Martin7483 - 09-30-2015, 02:37 AM
RE: Custom Validation Function - by ardavan - 09-30-2015, 03:13 AM
RE: Custom Validation Function - by Martin7483 - 09-30-2015, 03:39 AM
RE: Custom Validation Function - by Martin7483 - 09-30-2015, 07:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB