• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.