diff options
Diffstat (limited to 'framework/Web/UI/WebControls/TEmailAddressValidator.php')
-rw-r--r-- | framework/Web/UI/WebControls/TEmailAddressValidator.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/framework/Web/UI/WebControls/TEmailAddressValidator.php b/framework/Web/UI/WebControls/TEmailAddressValidator.php index 48516c44..b6ceff90 100644 --- a/framework/Web/UI/WebControls/TEmailAddressValidator.php +++ b/framework/Web/UI/WebControls/TEmailAddressValidator.php @@ -20,7 +20,7 @@ Prado::using('System.Web.UI.WebControls.TRegularExpressionValidator'); *
* TEmailAddressValidator validates whether the value of an associated
* input component is a valid email address. It will check MX record
- * if checkdnsrr() is implemented.
+ * if checkdnsrr() is available in the installed PHP.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Revision: $ $Date: $
@@ -29,14 +29,24 @@ Prado::using('System.Web.UI.WebControls.TRegularExpressionValidator'); */
class TEmailAddressValidator extends TRegularExpressionValidator
{
+ /**
+ * Regular expression used to validate the email address
+ */
const EMAIL_REGEXP="\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
+ /**
+ * @return string the regular expression that determines the pattern used to validate a field.
+ */
public function getRegularExpression()
{
$regex=parent::getRegularExpression();
return $regex===''?self::EMAIL_REGEXP:$regex;
}
+ /**
+ * Returns an array of javascript validator options.
+ * @return array javascript validator options.
+ */
public function evaluateIsValid()
{
$valid=parent::evaluateIsValid();
|