PHP Class yii\validators\EmailValidator

Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends Validator
ファイルを表示 Open project: yiisoft/yii2 Class Usage Examples

Public Properties

Property Type Description
$allowName whether to allow name in the email address (e.g. "John Smith "). Defaults to false.
$checkDNS whether to check whether the email's domain exists and has either an A or MX record. Be aware that this check can fail due to temporary DNS problems even if the email address is valid and an email would be deliverable. Defaults to false.
$enableIDN whether validation process should take into account IDN (internationalized domain names). Defaults to false meaning that validation of emails containing IDN will always fail. Note that in order to use IDN validation you have to install and enable intl PHP extension, otherwise an exception would be thrown.
$fullPattern the regular expression used to validate email addresses with the name part. This property is used only when [[allowName]] is true.
$pattern the regular expression used to validate the attribute value.

Public Methods

Method Description
clientValidateAttribute ( $model, $attribute, $view )
init ( )

Protected Methods

Method Description
validateValue ( $value )

Method Details

clientValidateAttribute() public method

public clientValidateAttribute ( $model, $attribute, $view )

init() public method

public init ( )

validateValue() protected method

protected validateValue ( $value )

Property Details

$allowName public_oe property

whether to allow name in the email address (e.g. "John Smith "). Defaults to false.
See also: fullPattern
public $allowName

$checkDNS public_oe property

whether to check whether the email's domain exists and has either an A or MX record. Be aware that this check can fail due to temporary DNS problems even if the email address is valid and an email would be deliverable. Defaults to false.
public $checkDNS

$enableIDN public_oe property

whether validation process should take into account IDN (internationalized domain names). Defaults to false meaning that validation of emails containing IDN will always fail. Note that in order to use IDN validation you have to install and enable intl PHP extension, otherwise an exception would be thrown.
public $enableIDN

$fullPattern public_oe property

the regular expression used to validate email addresses with the name part. This property is used only when [[allowName]] is true.
See also: allowName
public $fullPattern

$pattern public_oe property

the regular expression used to validate the attribute value.
See also: http://www.regular-expressions.info/email.html
public $pattern