CI4 Validation - how use/work with calleble functions |
Hi everyone, I've read CI4-manual for validation library and not found example code how use/work with calleble or anonymous functions? When I use example code from CI3 - this code don't works
. May be anybody know how use calleble/ anonymous functions validation in CI4-version. Sorry for my English.
My exaple rule for email code: PHP Code: 'email' => [
See the news tutorial in the CodeIgniter 4 User Guide.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Agreed - the tutorial does not appear to deal with custom validation rules
Not a full example, but https://codeigniter4.github.io/CodeIgnit...stom-rules
Custom validation rules are done this way:
See https://forum.codeigniter.com/thread-72343.html
Simpler is always better
(04-18-2019, 09:37 AM)ciadmin Wrote: Agreed - the tutorial does not appear to deal with custom validation rules If I am understand right, that anonymous function was removed from validation library? And when i need to use ONE anonymous function in my rules (in my case) - i must create special custom class for that, which i registered in Config/Validation.php ? I think in this case it's not right way - create class for one rule... |
Welcome Guest, Not a member yet? Register Sign In |