$_templates
$_templates : \Cake\View\StringTemplate
StringTemplate instance.
Input widget for creating checkbox widgets.
This input class can be used to render basic simple input elements like hidden, text, email, tel and other types.
$_templates : \Cake\View\StringTemplate
StringTemplate instance.
__construct(\Cake\View\StringTemplate $templates)
Constructor.
| \Cake\View\StringTemplate | $templates | Templates list. |
render(array $data, \Cake\View\Form\ContextInterface $context) : string
Render a checkbox element.
Data supports the following keys:
name - The name of the input.value - The value attribute. Defaults to '1'.val - The current value. If it matches value the checkbox will be checked.
You can also use the 'checked' attribute to make the checkbox checked.disabled - Whether or not the checkbox should be disabled.Any other attributes passed in will be treated as HTML attributes.
| array | $data | The data to create a checkbox with. |
| \Cake\View\Form\ContextInterface | $context | The current form context. |
Generated HTML string.