Form Validation Library - callback implementation flaw |
The Codeigniter Form Verification library allows creating custom "callback" rules implemented in functions as described in the Documentation.
It seems to me that there is a flaw in how it is implemented. It appears that the callback function must be a method of the main CodeIgniter object: https://github.com/bcit-ci/CodeIgniter/b...n.php#L715 PHP Code: // Call the function that corresponds to the rule It forces the callback function to be public method of the controller. The callback can't be part of a helper or a library, because nor helper nor library derive from CodeIgniter main object. Because the callback is a public method of the controller it can be called directly. In case of the example in documentation accessing Code: https://example.org/example_app/form/username_check/test Isn't it a design flaw or am I missing something?
You can prepend it with _ to hide it from the automatic url resolver. Have only tried to load it locally within the same class, so can't comment of the rest.
|
Welcome Guest, Not a member yet? Register Sign In |