__construct()
getMessage()
getName()
setMessage()
validate()
_init()
_isNoUserValue()
_getValidationStrategy()
$_message
$_checkDns
$_name
$_validationStrategy
Email rule checks if a valid email address is entered.
The following arguments are supported: - (boolean)'checkDns': Performs DNS lookup
category | Formagic |
---|---|
package | Rule |
author | Marc Schrader |
author | Florian Sonnenburg |
copyright | Copyright (c) 2007-2011 Florian Sonnenburg |
version | $Id: Email.php 169 2012-05-06 20:16:16Z meweasle $ |
__construct(array $arguments)
The default error message that is displayed if the rule is violated can be overwritten by $errorMessage.
see | \self::_init() |
---|---|
inherited_from | \Formagic_Rule_Abstract::__construct() |
array
The rule options.
getMessage() : string
inherited_from | \Formagic_Rule_Abstract::getMessage() |
---|
string
Message stringgetName() : string
inherited_from | \Formagic_Rule_Abstract::getName() |
---|
string
The rule namesetMessage(mixed $message) : \Formagic_Rule_Abstract
Usually a rule will have one error message string that is used if the validation fails. If neccessary, Formagic_Rule_Abstract::_errorMessage can hold other variables, eg. an array of error messages for different outcomes of the validation process.
Implements a fluent interface pattern.
see | \Formagic_Rule_Abstract::__construct() |
---|---|
inherited_from | \Formagic_Rule_Abstract::setMessage() |
mixed
The error message value.
\Formagic_Rule_Abstract
$this object.validate(string $value) : boolean
Subclasses have to implement their behavior here.
string
Item value object to be validated
boolean
True if the item value is email formatted_init(array $arguments) : void
Supported keys:
array
Array of arguments
\Formagic_Exception |
If given validationStrategy is not valid |
---|
_isNoUserValue(\$value $value) : boolean
The value 0 (zero) for example could be something the user entered willingly and would be skipped from rule checks when using empty().
inherited_from | \Formagic_Rule_Abstract::_isNoUserValue() |
---|
\$value
mixed Value to be checked
boolean
_getValidationStrategy() : \Formagic_Rule_EmailValidation_Interface
Defaults to Formagic_Rule_EmailValidation_PhpFilter if PHP version suffices, or to more expensive Formagic_Rule_EmailValidation_Regex if not.
$_checkDns : boolean
$_name : string
inherited_from | \Formagic_Rule_Abstract::$$_name |
---|
$_validationStrategy : \Formagic_Rule_Email_ValidationInterface