• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI4 Validation - how use/work with calleble functions

#1
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.