PHP 클래스 yii\validators\DefaultValueValidator

DefaultValueValidator is not really a validator. It is provided mainly to allow specifying attribute default values when they are empty.
부터: 2.0
저자: Qiang Xue ([email protected])
상속: extends Validator
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$skipOnEmpty this property is overwritten to be false so that this validator will be applied when the value being validated is empty.
$value the default value or an anonymous function that returns the default value which will be assigned to the attributes being validated if they are empty. The signature of the anonymous function should be as follows, php function($model, $attribute) { compute value return $value; }

공개 메소드들

메소드 설명
validateAttribute ( $model, $attribute )

메소드 상세

validateAttribute() 공개 메소드

public validateAttribute ( $model, $attribute )

프로퍼티 상세

$skipOnEmpty 공개적으로 프로퍼티

this property is overwritten to be false so that this validator will be applied when the value being validated is empty.
public $skipOnEmpty

$value 공개적으로 프로퍼티

the default value or an anonymous function that returns the default value which will be assigned to the attributes being validated if they are empty. The signature of the anonymous function should be as follows, php function($model, $attribute) { compute value return $value; }
public $value