External Codeigniter Form Callbacks

I need to check if user_id that was inserted exists. I was going to use callbacks in Codeigniter form validation, but they need a function that performs validation in the controller. I use this on many pages through several controllers, so I thought I would do it in the model. Codeigniter does not support this, though.

http://codeigniter.com/forums/viewthread/205469/

I found this, but it seems like a lot of code to check. I use this a lot, so I don’t want this big globe of code every time.

How can I run form validation from a model with a minimal amount of code?

+4
source share
1 answer

Extend CI_Form_Validation . This way you can call your callbacks just like all the other Codeigniter validation functions.

+6
source

All Articles