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 $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 $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 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 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 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\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 $falseValue

$falseValue public property The value representing false status. Defaults to '0'. public mixed $falseValue = '0'

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