validators\CompareValidator $type

$type public property The type of the values being compared. The follow types are supported: string: the values are being compared as strings. No conversion will be done before comparison. number: the values are being compared as numbers. String values will be converted into numbers before comparison. public string $type = self::TYPE_STRING

validators\CompareValidator $operator

$operator public property The operator for comparison. The following operators are supported: ==: check if two values are equal. The comparison is done is non-strict mode. ===: check if two values are equal. The comparison is done is strict mode. !=: check if two values are NOT equal. The comparison is done is non-strict mode. !==: check if two values are NOT equal. The comparison is done is strict mode. >: check if value being validated is greater than the value being compared with

validators\CompareValidator $message

$message public property 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 {compareValue}: the value or the attribute label to be compared with {compareAttribute}: the label of the attribute to be compared with {compareValueOrAttribute}: the value or the attribute label to be compared with public string

validators\CompareValidator $compareValue

$compareValue public property The constant value to be compared with. When both this property and $compareAttribute are set, this property takes precedence. See also $compareAttribute. public mixed $compareValue = null

validators\CompareValidator $compareAttribute

$compareAttribute public property The name of the attribute to be compared with. When both this property and $compareValue are set, the latter takes precedence. If neither is set, it assumes the comparison is against another attribute whose name is formed by appending '_repeat' to the attribute being validated. For example, if 'password' is being validated, then the attribute to be compared would be 'password_repeat'. See also $compareValue. public string $compareAttribute = null

validators\BooleanValidator validateValue()

validateValue() protected method Validates a value. A validator class can implement this method to support data validation out of the context of a data model. protected array|null validateValue ( $value )$value mixed The data value to be validated. return array|null The error message and the parameters to be inserted into the error message. Null should be returned if the data is valid. throws yii\base\NotSupportedException if the validator does not supporting data validation withou

validators\BooleanValidator init()

init() public method Initializes the object. This method is invoked at the end of the constructor after the object is initialized with the given configuration. public void init ( )

validators\BooleanValidator clientValidateAttribute()

clientValidateAttribute() public method Returns the JavaScript needed for performing client-side validation. You may override this method to return the JavaScript validation code if the validator can support client-side validation. The following JavaScript variables are predefined and can be used in the validation code: attribute: an object describing the the attribute being validated. value: the value being validated. messages: an array used to hold the validation error messages for the

validators\BooleanValidator $trueValue

$trueValue public property The value representing true status. Defaults to '1'. public mixed $trueValue = '1'

validators\BooleanValidator $strict

$strict public property Whether the comparison to $trueValue and $falseValue is strict. When this is true, the attribute value and type must both match those of $trueValue or $falseValue. Defaults to false, meaning only the value needs to be matched. public boolean $strict = false