Public Member Functions | |
| __construct ($name) | |
| Create a new AnewtFormControlCheckbox instance. | |
| fill ($values) | |
| Fill the form control from the given values. | |
| build_widget () | |
| Render the minimal HTML needed for this control to work. | |
This control renders a HTML input element. Checkboxes have two labels, label and secondary-label, both of which may be set (both optional). Form renderers should render the label value just like labels for other controls are rendered. The secondary-label (if set) will be shown right next to the checkbox itself.
If you want multiple consecutive AnewtFormControlCheckbox controls to have the user check zero or more items, consider using AnewtFormControlChoice with the multiple property enabled instead.
Note that for yes/no-like questions you may also use AnewtFormControlChoice with just two options (and make sure it renders as two radio buttons; this is the default if you have just 2 options).
Definition at line 28 of file choice.lib.php.
| AnewtFormControlCheckbox::__construct | ( | $ | name | ) |
Create a new AnewtFormControlCheckbox instance.
| $name | The name of this control. |
Reimplemented from AnewtFormControl.
Definition at line 36 of file choice.lib.php.
| AnewtFormControlCheckbox::fill | ( | $ | values | ) |
Fill the form control from the given values.
This only sets the value for controls for which the can-be-filled property is enabled.
The return value of this function indicates whether the control was successfully filled with a value. For some control types such as checkboxes this always succeeds since both presence and absence of the value from $values are meaningful. For other controls such as text inputs this is only true if the value was actually present in the $values parameters.
| $values | An associative array from which the form control should be filled. |
true if filling was succesfull, false otherwise.Reimplemented from AnewtFormControl.
Definition at line 44 of file choice.lib.php.
| AnewtFormControlCheckbox::build_widget | ( | ) |
Render the minimal HTML needed for this control to work.
Form control implementations should implement this method, e.g. for a checkbox a simple input HTML element should be returned.
Reimplemented from AnewtFormControl.
Definition at line 57 of file choice.lib.php.
1.5.9