Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
EmailValidator.php
Go to the documentation of this file.
1<?php
2
4
13
14 public function __construct() {
15 $this->message = "{value} is not a valid email address";
16 $this->ref = "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/i";
17 $this->match = true;
18 }
19
25 public function asUI(): array {
26 return ['inputType'=>'email']+\array_merge_recursive(parent::asUI () , ['rules' => [ 'email' ]]);
27 }
28}
29
Validates an email address Usage @validator("email")
asUI()
{{}\Ubiquity\contents\validation\validators\ValidatorasUI()}
Validates a string with a regex Usage @validator("regex",pattern)