PHP 클래스 yii\validators\RequiredValidator

부터: 2.0
저자: Qiang Xue ([email protected])
상속: extends Validator
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$message the user-defined error message. It may contain the following placeholders which will be replaced accordingly by the validator: - {attribute}: the label of the attribute being validated - {value}: the value of the attribute being validated - {requiredValue}: the value of [[requiredValue]]
$requiredValue the desired value that the attribute must have. If this is null, the validator will validate that the specified attribute is not empty. If this is set as a value that is not null, the validator will validate that the attribute has a value that is the same as this property value. Defaults to null.
$skipOnEmpty whether to skip this validator if the value being validated is empty.
$strict whether the comparison between the attribute value and [[requiredValue]] is strict. When this is true, both the values and types must match. Defaults to false, meaning only the values need to match. Note that when [[requiredValue]] is null, if this property is true, the validator will check if the attribute value is null; If this property is false, the validator will call [[isEmpty]] to check if the attribute value is empty.

공개 메소드들

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

보호된 메소드들

메소드 설명
validateValue ( $value )

메소드 상세

clientValidateAttribute() 공개 메소드

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

init() 공개 메소드

public init ( )

validateValue() 보호된 메소드

protected validateValue ( $value )

프로퍼티 상세

$message 공개적으로 프로퍼티

the user-defined error message. It may contain the following placeholders which will be replaced accordingly by the validator: - {attribute}: the label of the attribute being validated - {value}: the value of the attribute being validated - {requiredValue}: the value of [[requiredValue]]
public $message

$requiredValue 공개적으로 프로퍼티

the desired value that the attribute must have. If this is null, the validator will validate that the specified attribute is not empty. If this is set as a value that is not null, the validator will validate that the attribute has a value that is the same as this property value. Defaults to null.
또한 보기: strict
public $requiredValue

$skipOnEmpty 공개적으로 프로퍼티

whether to skip this validator if the value being validated is empty.
public $skipOnEmpty

$strict 공개적으로 프로퍼티

whether the comparison between the attribute value and [[requiredValue]] is strict. When this is true, both the values and types must match. Defaults to false, meaning only the values need to match. Note that when [[requiredValue]] is null, if this property is true, the validator will check if the attribute value is null; If this property is false, the validator will call [[isEmpty]] to check if the attribute value is empty.
public $strict