custom validation function placement

#1
[eluser]Jayson Ng[/eluser]
when creating your own function to check for form validation, does it need to be placed IN the same controller?

because I tried putting my custom function in its own plugin (so I could easily re-use it in other projects) but that didn't work.

any help would be appreciated.

thanks!
-Jayson

#2
[eluser]InsiteFX[/eluser]
Try putting it inside a library
This way you can autoload it and use it at anytime.

Enjoy
InsiteFX

#3
[eluser]Aken[/eluser]
The callback function does need to be in the same controller as the form validation. However, that function can pull whatever it needs to do the job. So create your plugin, then create your callback function inside the controller, and call your plugin from the callback function.

#4
[eluser]Jayson Ng[/eluser]
@aken: thanks! sounds like this is the way to go. Smile

#5
[eluser]pistolPete[/eluser]
Did you consider extending the form_validation library?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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