stopka/nette-forms-checkbox-component

Checkbox component for Nette forms with caption on in the label part.

v1.0 2020-11-17 22:07 UTC

This package is auto-updated.

Last update: 2024-04-18 05:37:10 UTC


README

CheckboxControl with ability to set caption in label part as usual for other form controls.

Usage

Labels are rendered next to the input as in usual checkbox, captions are renderd in "label" part of the form (usually on the left)

$form = new Form();
$form['checkbox'] = (new CheckboxControl('Some label'))->setCaption('Some caption');

Optionaly add trait to your form:

class MyForm extends Form{
    use CheckboxControlContainerTrait;

}

$form = new MyForm();
$form->addExtendedCheckbox('checkbox', 'Some label')
    ->setCaption('Some caption');