Checks if value is between min and max length
If only one numeric value is passed as argument, this value is interpreted as min length value.
Supported arguments are:
Formagic_Rule_StringLength::__construct(array(
'min' => (int)$min,
'max' => (int)$max,
'messages' => array(
'min' => (string)$errorMessage,
'min' => (string)$errorMessage,
'between' => (string)$errorMessage,
)
)); Formagic_Rule_StringLength::__construct(array('min' => (int)$min, 'max' => (int)$max));
package | Formagic\Rule |
---|---|
author | Marc Schrader |
author | Florian Sonnenburg |
since | 1.0.0 First time introduced |
inherited_from | \Formagic_Rule_RangeComparison_Abstract |
__construct(array $arguments = array()
)
getMessage() : string
string
Message stringgetName() : string
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 |
---|
mixed
The error message value.
\Formagic_Rule_Abstract
$this object.setMessages(array $messages) : \Formagic_Rule_RangeComparison_Abstract
array
Array of messages
\Formagic_Rule_RangeComparison_Abstract
validate(string $value) : boolean
Subclasses have to implement their behavior here.
string
The value to be validated.
boolean
The rule check result_execBetween(integer $range) : boolean
integer
Range value
boolean
Evaluation result_execMax(integer $range) : boolean
integer
Upper limit
boolean
Evaluation result_execMin(integer $range) : boolean
integer
Lower limit
boolean
Evaluation result_getMessage(string $key) : string
string
Message type
string
Translated filled message_getRange(string $value) : integer
inherited_from | \Formagic_Rule_RangeComparison_Abstract::_getRange() |
---|
string
Item value
integer
Range check value_getRange(string $value) : mixed
string
Item value
mixed
Check range value_init(array $arguments) : void
array
Array of arguments passed to __construct()
_isNoUserValue($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().
mixed Value to be checked
boolean
$_max : integer
$_min : integer
$_name : string