![]() |
Can't use call back function in form validation - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Can't use call back function in form validation (/showthread.php?tid=32327) |
Can't use call back function in form validation - El Forum - 07-20-2010 [eluser]weblizzer[/eluser] Hi Everyone, I just have a question, why I can't call my callback function within the model? I put my validation of model and I have 2 call back function which I will be call for custom validation. Only the problem is that when It doesn't perform the callback function though when I try to put it into the controller it does work. Any advise? Thanks Can't use call back function in form validation - El Forum - 07-20-2010 [eluser]smilie[/eluser] As far as I got with controller > model (and forms) - model has no idea about the form what so ever. My workaround is to pass (once more) all form values from controller to model. Not the nicest / easiest way, but it works. Regards, Smilie Can't use call back function in form validation - El Forum - 07-21-2010 [eluser]flaky[/eluser] I take this way of coding Views - GUI, User Interface Controller - Application logic and data validation Models - Database layer access Form validation callback, by this logic fall into the controller not model Can't use call back function in form validation - El Forum - 07-21-2010 [eluser]Eric Barnes[/eluser] Or just create a wrapper to the model. This would be in controller: Code: public function username_check($username) |