Class CDefaultValueValidator
CDefaultValueValidator sets the attributes with the specified value. It does
not do validation but rather allows setting a default value at the same time
validation is performed. Usually this happens when calling either <span
class="php-var">$model</span>->validate()
or <span
class="php-var">$model</span>->save()
.
- CComponent
- CValidator
- CDefaultValueValidator
Package: system\validators
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Located at x2engine/framework/validators/CDefaultValueValidator.php
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Located at x2engine/framework/validators/CDefaultValueValidator.php
protected
|
addError(),
applyTo(),
clientValidateAttribute(),
createValidator(),
isEmpty(),
validate()
|
public
mixed
|
$value |
|
#
the default value to be set to the specified attributes. |
public
boolean
|
$setOnEmpty | true |
#
whether to set the default value only when the attribute value is null or empty string. Defaults to true. If false, the attribute will always be assigned with the default value, even if it is already explicitly assigned a value. |
$attributes,
$builtInValidators,
$enableClientValidation,
$except,
$message,
$on,
$safe,
$skipOnError
|