Welcome Guest, Not a member yet? Register   Sign In
Lib Validation : permit empty string for valid_email or extend rule
#1

Hello everyone, I want to use validation for mail field which is not required. But empty string is not validated. Is there a method to validate it anyway ?
Or the other option I think is to custom the predefined rule "valid_email", is it possible ?
In advance, thank you.
Reply
#2

you can combine it wih other rule. E.g.

$rules = [
'email' => 'permit_empty|valid_email',
];

See https://codeigniter.com/user_guide/libra...eneral-use
@xxxx[{::::::::::::::::::::::::::::::::>
Reply
#3

Yes, it works ! Thank you.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB