コード例 #1
0
ファイル: EmailValidator.php プロジェクト: airymvc/airymvc2
 /**
  * @param string $pattern Default value = NULL
  * @param string $errorMsg Default value = NULL
  */
 public function setEmailValid($pattern = NULL, $errorMsg = NULL)
 {
     $errorMsg = is_null($errorMsg) ? $this->_defaultMsg : $errorMsg;
     $pattern = is_null($pattern) ? $this->_defaultPattern : $pattern;
     $rule = new EmailRule();
     $rule->setRule($pattern);
     $this->_validRules[] = array(0 => $rule, 1 => $errorMsg);
 }
コード例 #2
0
  protected function checkDomain($value)
  {
    parent::checkDomain($value);

    if ($this->isValid())
    {
      if (!checkdnsrr($value, "MX"))
      {
        $this->error('EMAIL_DNS');
      }
    }
  }