1 | <?php |
||
13 | class Checkbox extends Element\Input { |
||
14 | |||
15 | protected $attributes = [ |
||
16 | 'type' => 'checkbox', |
||
17 | ]; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $label = ''; |
||
23 | |||
24 | protected $isChecked = false; |
||
25 | |||
26 | |||
27 | 1 | public function isValid() { |
|
30 | |||
31 | |||
32 | /** |
||
33 | * @inheritdoc |
||
34 | */ |
||
35 | 8 | public function handle(FormData $data) { |
|
39 | |||
40 | |||
41 | /** |
||
42 | * @return bool |
||
43 | */ |
||
44 | 7 | public function isChecked() { |
|
47 | |||
48 | |||
49 | /** |
||
50 | * @param bool $isChecked |
||
51 | * @return $this |
||
52 | */ |
||
53 | 8 | public function setChecked($isChecked) { |
|
62 | |||
63 | |||
64 | /** |
||
65 | * @inheritdoc |
||
66 | */ |
||
67 | 9 | public function setAttribute($name, $value) { |
|
73 | |||
74 | |||
75 | /** |
||
76 | * @inheritdoc |
||
77 | */ |
||
78 | 2 | public function removeAttribute($name) { |
|
84 | |||
85 | |||
86 | /** |
||
87 | * @param string $text |
||
88 | * @return $this |
||
89 | */ |
||
90 | public function setLabel($text) { |
||
94 | |||
95 | |||
96 | /** |
||
97 | * @return string |
||
98 | */ |
||
99 | 1 | public function render() { |
|
102 | |||
103 | |||
104 | /** |
||
105 | * @return $this |
||
106 | * @deprecated |
||
107 | */ |
||
108 | public function check() { |
||
113 | |||
114 | |||
115 | /** |
||
116 | * Set value to 0 |
||
117 | * @return $this |
||
118 | * @deprecated |
||
119 | */ |
||
120 | public function unCheck() { |
||
125 | |||
126 | |||
127 | /** |
||
128 | * @deprecated |
||
129 | */ |
||
130 | public function getValue() { |
||
133 | |||
134 | |||
135 | /** |
||
136 | * @deprecated |
||
137 | */ |
||
138 | public function setValue($value) { |
||
142 | |||
143 | } |