PHP Класс 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.
С версии: 2.0
Автор: Qiang Xue ([email protected])
Наследование: extends Validator
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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)

Открытые методы

Метод Описание
clientValidateAttribute ( $model, $attribute, $view )
init ( )
validateAttribute ( $model, $attribute )

Защищенные методы

Метод Описание
validateValue ( $value )

Описание методов

clientValidateAttribute() публичный Метод

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

init() публичный Метод

public init ( )

validateAttribute() публичный Метод

public validateAttribute ( $model, $attribute )

validateValue() защищенный Метод

protected validateValue ( $value )

Описание свойств

$allowArray публичное свойство

whether to allow array type attribute.
public $allowArray

$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]].
public $not

$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; }
public $range

$strict публичное свойство

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