InputfieldCheckbox class
An Inputfield for handling a single checkbox
Note: if you want a checkbox already checked, you need to $inputfield->setAttribute('checked', 'checked');
Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the Inputfield
class also inherits all the methods and properties of: Inputfield, WireData and Wire.
Common
Properties
Name | Return | Summary | Default |
---|---|---|---|
Inputfield | int | When set to 1, setting value attribute to non-blank/non-zero automatically triggers checked. | 0 |
Inputfield | string | Same as label2, but used as part of field config rather than API-only config. | |
Inputfield | bool | Show only the checkbox without label text next to it? 3.0.144 | false |
Inputfield | string | Value when checked | 1 |
Inputfield | string | Alterate label to display next to checkbox | label |
Inputfield | array | Optional attributes for <label> element that surrounds checkbox 3.0.141 | [] |
Inputfield | string | Value when not checked | '' |
Additional methods and properties
In addition to the methods and properties above, Inputfield
API reference based on ProcessWire core version 3.0.251