Class CRangeValidator
CRangeValidator validates that the attribute value is among the list
(specified via CRangeValidator::$range
). You may invert the validation logic with help of
the CRangeValidator::$not
property (available since 1.1.5).
- CComponent
- CValidator
- CRangeValidator
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/validators/CRangeValidator.php
protected
|
#
validateAttribute(
Validates the attribute of the object. If there is any error, the error message is added to the object. |
public
string
|
#
clientValidateAttribute(
Returns the JavaScript needed for performing client-side validation. |
addError(),
applyTo(),
createValidator(),
isEmpty(),
validate()
|
public
array
|
$range |
|
#
list of valid values that the attribute value should be among |
public
boolean
|
$strict | false |
#
whether the comparison is strict (both type and value must be the same) |
public
boolean
|
$allowEmpty | true |
#
whether the attribute value can be null or empty. Defaults to true, meaning that if the attribute is empty, it is considered valid. |
public
boolean
|
$not | false |
#
whether to invert the validation logic. Defaults to false. If set to true,
the attribute value should NOT be among the list of values defined via |
$attributes,
$builtInValidators,
$enableClientValidation,
$except,
$message,
$on,
$safe,
$skipOnError
|