Welcome Guest, Not a member yet? Register   Sign In
callbacks in library
#1

[eluser]Unknown[/eluser]
Hey, codeIgniter community. I have some questions. Lets say I have controller:

Code:
class Test extends CI_Controller{

     public function test(){

           $this->form_validation->set_rules("test", "test", "callback_test");

     }

     public function test($str){

          doing stuff..... blah blah

     }

}

So, I using callback from same controller... How I can, put all my callbacks in library, so they can be reached from any controllers, or i can put same library in others projects? I hope will understand my question. Sorry for bad english.
#2

[eluser]Aken[/eluser]
Extend the Form_validation library and add your rules there. Then you can specify them like any other rule: without the callback_ prefix.




Theme © iAndrew 2016 - Forum software by © MyBB