PHP Класс yii\validators\DefaultValueValidator

DefaultValueValidator is not really a validator. It is provided mainly to allow specifying attribute default values when they are empty.
С версии: 2.0
Автор: Qiang Xue ([email protected])
Наследование: extends Validator
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$skipOnEmpty this property is overwritten to be false so that this validator will be applied when the value being validated is empty.
$value the default value or an anonymous function that returns the default value which will be assigned to the attributes being validated if they are empty. The signature of the anonymous function should be as follows, php function($model, $attribute) { compute value return $value; }

Открытые методы

Метод Описание
validateAttribute ( $model, $attribute )

Описание методов

validateAttribute() публичный Метод

public validateAttribute ( $model, $attribute )

Описание свойств

$skipOnEmpty публичное свойство

this property is overwritten to be false so that this validator will be applied when the value being validated is empty.
public $skipOnEmpty

$value публичное свойство

the default value or an anonymous function that returns the default value which will be assigned to the attributes being validated if they are empty. The signature of the anonymous function should be as follows, php function($model, $attribute) { compute value return $value; }
public $value