Sep 24 2011
CodeIgniter Hack Form_Validation Callbacks
When im writting a Codeigniter 2 application I prefer to have most of my code in the libraries and leave the controller as blank as possible. This allows me to reuse code like forms in other sections of the site. eg you want the login for to be in 2 different places. However Codeigniter’s Form_valiation class does not allow for custom validation callbacks in a library. The only way to fix this is to hack the Form_validation class. I have created a modification that allows you to call a validation callback from any class.