PHP Class yii\validators\BooleanValidator

Possible boolean values can be configured via the [[trueValue]] and [[falseValue]] properties. And the comparison can be either [[strict]] or not.
Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends Validator
ファイルを表示 Open project: yiisoft/yii2 Class Usage Examples

Public Properties

Property Type Description
$falseValue the value representing false status. Defaults to '0'.
$strict 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.
$trueValue the value representing true status. Defaults to '1'.

Public Methods

Method Description
clientValidateAttribute ( $model, $attribute, $view )
init ( )

Protected Methods

Method Description
validateValue ( $value )

Method Details

clientValidateAttribute() public method

public clientValidateAttribute ( $model, $attribute, $view )

init() public method

public init ( )

validateValue() protected method

protected validateValue ( $value )

Property Details

$falseValue public_oe property

the value representing false status. Defaults to '0'.
public $falseValue

$strict public_oe 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 $strict

$trueValue public_oe property

the value representing true status. Defaults to '1'.
public $trueValue