PHP 클래스 yii\validators\FilterValidator

FilterValidator is actually not a validator but a data processor. It invokes the specified filter callback to process the attribute value and save the processed value back to the attribute. The filter must be a valid PHP callback with the following signature: php function foo($value) { compute $newValue here return $newValue; } Many PHP functions qualify this signature (e.g. trim()). To specify the filter, set [[filter]] property to be the callback.
부터: 2.0
저자: Qiang Xue ([email protected])
상속: extends Validator
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$filter the filter. This can be a global function name, anonymous function, etc. The function signature must be as follows, php function foo($value) { compute $newValue here return $newValue; }
$skipOnArray whether the filter should be skipped if an array input is given. If true and an array input is given, the filter will not be applied.
$skipOnEmpty this property is overwritten to be false so that this validator will be applied when the value being validated is empty.

공개 메소드들

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

메소드 상세

clientValidateAttribute() 공개 메소드

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

init() 공개 메소드

public init ( )

validateAttribute() 공개 메소드

public validateAttribute ( $model, $attribute )

프로퍼티 상세

$filter 공개적으로 프로퍼티

the filter. This can be a global function name, anonymous function, etc. The function signature must be as follows, php function foo($value) { compute $newValue here return $newValue; }
public $filter

$skipOnArray 공개적으로 프로퍼티

whether the filter should be skipped if an array input is given. If true and an array input is given, the filter will not be applied.
public $skipOnArray

$skipOnEmpty 공개적으로 프로퍼티

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