Class CFilterValidator
CFilterValidator transforms the data being validated based on a filter.
CFilterValidator is actually not a validator but a data processor. It invokes the specified filter method to process the attribute value and save the processed value back to the attribute. The filter method must follow the following signature:
function foo($value) {...return $newValue; }
Many PHP 'built in' functions qualify this signature (e.g. trim).
To specify the filter method, set CFilterValidator::$filter
property to be the function
name.
- CComponent
- CValidator
- CFilterValidator
Package: system\validators
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/CFilterValidator.php
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/CFilterValidator.php
protected
|
#
validateAttribute(
Validates the attribute of the object. If there is any error, the error message is added to the object. |
addError(),
applyTo(),
clientValidateAttribute(),
createValidator(),
isEmpty(),
validate()
|
public
callable
|
$filter |
|
#
the filter method |
$attributes,
$builtInValidators,
$enableClientValidation,
$except,
$message,
$on,
$safe,
$skipOnError
|