1 | <?php |
||
5 | class Checkbox extends Field |
||
6 | { |
||
7 | |||
8 | const CHECKED = 'checked'; |
||
9 | |||
10 | const ON = 'on'; |
||
11 | |||
12 | /** |
||
13 | * Constructs a new checkbox |
||
14 | * |
||
15 | * @param string $slug |
||
16 | * @param string $label The string to display next to the checkbox |
||
17 | * @param bool $checked Whether the checkbox should be checked initially. Defaults to false |
||
18 | * @param int $storeValueLocally |
||
19 | */ |
||
20 | public function __construct ($slug, $label, $checked = false, $storeValueLocally = 0) |
||
24 | |||
25 | public function getClasses () |
||
31 | |||
32 | /** |
||
33 | * Set the "checked" state of this box |
||
34 | * @param bool $checked |
||
35 | */ |
||
36 | public function setChecked ($checked = true) |
||
40 | |||
41 | /** |
||
42 | * Is the checkbox checked in its current state? |
||
43 | * @return bool |
||
44 | */ |
||
45 | public function isChecked () |
||
49 | |||
50 | public function getAttributes () |
||
60 | |||
61 | public function getHTML ($showLabel = true) |
||
66 | |||
67 | protected function getRestoreDefault () |
||
72 | } |
||
73 |