FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Email.php
Go to the documentation of this file.
1 <?php
2 
4 
5 class Email extends Char{
6 
7  const DOMAINS = 'domains';
8  const DOMAIN_HINT = 'domainHint';
9 
10  public $regex = '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/'; //https://html.spec.whatwg.org/multipage/input.html#e-mail-state-(type=email)
11  public $domains = [];
12  public $domainHint = null;
13 
14  public function clientConfig(){
15  $config = parent::clientConfig();
16  if($this->domains) $config[self::DOMAINS] = $this->domains;
17  if($this->domainHint) $config[self::DOMAIN_HINT] = $this->trans->str($this->domainHint);
18  return $config;
19  }
20 
21  protected function checkDomain($value,$index = null){
22  return \Rsi\Valid::email($value);
23  }
24 
25 }
checkDomain($value, $index=null)
Definition: Email.php:21