1 | <?php |
||
21 | class BooleanValidator extends Validator |
||
22 | { |
||
23 | /** |
||
24 | * @var mixed the value representing true status. Defaults to '1'. |
||
25 | */ |
||
26 | public $trueValue = '1'; |
||
27 | /** |
||
28 | * @var mixed the value representing false status. Defaults to '0'. |
||
29 | */ |
||
30 | public $falseValue = '0'; |
||
31 | /** |
||
32 | * @var bool whether the comparison to [[trueValue]] and [[falseValue]] is strict. |
||
33 | * When this is true, the attribute value and type must both match those of [[trueValue]] or [[falseValue]]. |
||
34 | * Defaults to false, meaning only the value needs to be matched. |
||
35 | */ |
||
36 | public $strict = false; |
||
37 | |||
38 | |||
39 | /** |
||
40 | * @inheritdoc |
||
41 | */ |
||
42 | 7 | public function init() |
|
49 | |||
50 | /** |
||
51 | * @inheritdoc |
||
52 | */ |
||
53 | 3 | protected function validateValue($value) |
|
67 | |||
68 | /** |
||
69 | * @inheritdoc |
||
70 | */ |
||
71 | 1 | public function clientValidateAttribute($model, $attribute, $view) |
|
78 | |||
79 | /** |
||
80 | * @inheritdoc |
||
81 | */ |
||
82 | 1 | public function getClientOptions($model, $attribute) |
|
102 | } |
||
103 |