Codeigniter HMVC -> Call custom validators from MY_Form_validation.php file

265 Views Asked by At

How to create custom form validators in MY_Form_validation.php file in HMVC and run them in any module/controller in HMVC structure for validation purpose.

note :- I have no issues in running callback validators working fine no issues.

I want to create some general validators which I can apply on anywhere in project.

1

There are 1 best solutions below

3
On BEST ANSWER

you can create library file like this

class MY_Form_validation extends CI_Form_validation
{
    function custom() {

    }
}

and can call this function as you call other validation form function in HMVC