1 | <?php |
||
10 | class Checkbox extends AbstractElement implements ClickableInterface, InputInterface |
||
11 | { |
||
12 | /** |
||
13 | * @param boolean $value |
||
14 | */ |
||
15 | 2 | public function setValue($value) |
|
16 | { |
||
17 | $this->setAttribute('value', $value); |
||
18 | 2 | } |
|
19 | |||
20 | 1 | public function click() |
|
21 | { |
||
22 | if ($this->hasAttribute('checked')) { |
||
23 | $this->removeAttribute('checked'); |
||
24 | } else { |
||
25 | $this->setAttribute('checked', 'checked'); |
||
26 | 1 | } |
|
27 | } |
||
28 | |||
29 | /** |
||
30 | * @return string |
||
31 | */ |
||
32 | public function getValue() |
||
36 | } |
||
37 |