![]() |
Form validation function set as private fails - 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: Form validation function set as private fails (/showthread.php?tid=39637) |
Form validation function set as private fails - El Forum - 03-16-2011 [eluser]John5788[/eluser] I am just curious about the scope of a callback function for form validation. When I set the scope to private, the server throws a 500 error, but everything works when I have it as public. Is there a specific reason why it cannot be private? Form validation function set as private fails - El Forum - 03-16-2011 [eluser]WanWizard[/eluser] callback functions in your controller are called by the validation class. Which is external, so the callback method must be public to be accessible.. Form validation function set as private fails - El Forum - 03-29-2011 [eluser]raenk[/eluser] I had the same issue then I found a post mentioning an underscore as prefix to make function private, but still available for the validation class. You will have to make sure you add another underscore when calling the function on your rule: callback__your_function (double _). |