How to add callback_ function settings using an array |
Hi
I have problem setting rules using an array (Link). I add callbacks (Link) and unfortunately I receive an error like this "unable to access an error message corresponding you your field name Username. (blacklist) Simple code for my library validation PHP Code: class Validation_lib{ How to fix it? Callbacks is available in array? Thanks!
This is me. JK not me.
Change
PHP Code: public function callback_blacklist($str) to: PHP Code: public function callback_blacklist($username)
(09-15-2019, 08:33 AM)jreklund Wrote: Your function should be called blacklist() not callback_blacklist(). Hi, sorry late reply. Yes blacklist() not callback_blacklist(), I already tried it and didn't work. I wonder if callback_ function is not work in settings using an array... (09-15-2019, 06:12 AM)Wouter60 Wrote: Did you set the validation rules with: yes. Inside my controller. Example code: PHP Code: public function register(){
This is me. JK not me.
@falcon812311,
CI callback reference: https://codeigniter.com/user_guide/libra...on-methods While it may not matter...what version of CI are running? In your validation array "callback_" should be the prefix to your validation function blacklist(). The actual function should be called blacklist(). Is this how your code is currently? |
Welcome Guest, Not a member yet? Register Sign In |