Respect\Validation有值才验证怎么写? 为空不验证
文档不是有吗
没看到
https://www.workerman.net/doc/webman/components/validation.html#Validator%20%E5%8A%9F%E8%83%BD%E6%8C%87%E5%8D%97
$data = v::input( $param, [ 'name' => v::length(2, 20)->setName('姓名'), 'mobile' => v::length(11)->setName('手机'), 'email' => v::NullType()->email()->setName('邮箱'), ] ); email有值才验证,应该怎么写?
文档不是有吗
没看到
https://www.workerman.net/doc/webman/components/validation.html#Validator%20%E5%8A%9F%E8%83%BD%E6%8C%87%E5%8D%97
$data = v::input(
$param,
[
'name' => v::length(2, 20)->setName('姓名'),
'mobile' => v::length(11)->setName('手机'),
'email' => v::NullType()->email()->setName('邮箱'),
]
);
email有值才验证,应该怎么写?