Class CEmailValidator
CEmailValidator validates that the attribute value is a valid email address.
- CComponent
- CValidator
- CEmailValidator
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/validators/CEmailValidator.php
protected
|
#
validateAttribute(
Validates the attribute of the object. If there is any error, the error message is added to the object. |
public
boolean
|
#
validateValue( mixed $value )
Validates a static value to see if it is a valid email. Note that this method
does not respect |
public
string
|
#
clientValidateAttribute(
Returns the JavaScript needed for performing client-side validation. |
protected
boolean
|
#
checkMxPorts( string $domain )
Retrieves the list of MX records for $domain and checks if port 25 is opened on any of these. |
protected
boolean
|
#
mxSort( mixed $a, mixed $b )
Determines if one MX record has higher priority as another (i.e. 'pri' is
lower). Used by |
addError(),
applyTo(),
createValidator(),
isEmpty(),
validate()
|
public
string
|
$pattern | '/^[a-zA-Z0-9!#$%&\'*+\\/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&\'*+\\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/' |
#
the regular expression used to validate the attribute value. |
public
string
|
$fullPattern | '/^[^@]*<[a-zA-Z0-9!#$%&\'*+\\/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&\'*+\\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?>$/' |
#
the regular expression used to validate email addresses with the name part.
This property is used only when |
public
boolean
|
$allowName | false |
#
whether to allow name in the email address (e.g. "Qiang Xue <qiang.xue@gmail.com>"). Defaults to false. |
public
boolean
|
$checkMX | false |
#
whether to check the MX record for the email address. Defaults to false. To enable it, you need to make sure the PHP function 'checkdnsrr' exists in your PHP installation. Please note that this check may fail due to temporary problems even if email is deliverable. |
public
boolean
|
$checkPort | false |
#
whether to check port 25 for the email address. Defaults to false. To enable it, ensure that the PHP functions 'dns_get_record' and 'fsockopen' are available in your PHP installation. Please note that this check may fail due to temporary problems even if email is deliverable. |
public
boolean
|
$allowEmpty | true |
#
whether the attribute value can be null or empty. Defaults to true, meaning that if the attribute is empty, it is considered valid. |
public
boolean
|
$validateIDN | false |
#
whether validation process should care about IDN (internationalized domain names). Default value is false which means that validation of emails containing IDN will always fail. |
$attributes,
$builtInValidators,
$enableClientValidation,
$except,
$message,
$on,
$safe,
$skipOnError
|