04-17-2019, 11:54 PM
(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:
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'
]
]