PHP Class yii\validators\RangeValidator

The range can be specified via the [[range]] property. If the [[not]] property is set true, the validator will ensure the attribute value is NOT among the specified range.
Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends Validator
Afficher le fichier Open project: yiisoft/yii2 Class Usage Examples

Méthodes publiques

Свойство Type Description
$allowArray whether to allow array type attribute.
$not whether to invert the validation logic. Defaults to false. If set to true, the attribute value should NOT be among the list of values defined via [[range]].
$range a list of valid values that the attribute value should be among or an anonymous function that returns such a list. The signature of the anonymous function should be as follows, php function($model, $attribute) { compute range return $range; }
$strict whether the comparison is strict (both type and value must be the same)

Méthodes publiques

Méthode Description
clientValidateAttribute ( $model, $attribute, $view )
init ( )
validateAttribute ( $model, $attribute )

Méthodes protégées

Méthode Description
validateValue ( $value )

Method Details

clientValidateAttribute() public méthode

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

init() public méthode

public init ( )

validateAttribute() public méthode

public validateAttribute ( $model, $attribute )

validateValue() protected méthode

protected validateValue ( $value )

Property Details

$allowArray public_oe property

whether to allow array type attribute.
public $allowArray

$not public_oe property

whether to invert the validation logic. Defaults to false. If set to true, the attribute value should NOT be among the list of values defined via [[range]].
public $not

$range public_oe property

a list of valid values that the attribute value should be among or an anonymous function that returns such a list. The signature of the anonymous function should be as follows, php function($model, $attribute) { compute range return $range; }
public $range

$strict public_oe property

whether the comparison is strict (both type and value must be the same)
public $strict