Welcome Guest, Not a member yet? Register   Sign In
CI4 Validation - how use/work with calleble functions
#1

(This post was last modified: 04-18-2019, 12:30 AM by Avega Soft.)

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' => [

 
                   'label'  => 'Email',
 
                   'rules'  => [

 
                       'required',
 
                       'valid_email',
 
                       [
 
                           'email_exist', function( $str )
 
                           {
 
                               return $this->checkExistsUserEmail$str );
 
                           }
 
                       ]
 
                   ],
 
                   'errors' => [

 
                       'email_exist' =>'Email not found'
 
                   ]
 
               
Reply


Messages In This Thread
CI4 Validation - how use/work with calleble functions - by Avega Soft - 04-17-2019, 11:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB