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
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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