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
Requires
- php: >=7.4
- nette/forms: ^3.0
Requires (Dev)
- dg/composer-frontline: ^0.2.0
- ergebnis/phpstan-rules: ^0.15.0
- mockery/mockery: ^1.3
- nepada/phpstan-nette-tester: ^0.3.0
- nette/tester: ^2.3
- phpstan/phpstan: ~0.12
- phpstan/phpstan-deprecation-rules: ^0.12.2
- phpstan/phpstan-mockery: ^0.12.5
- phpstan/phpstan-strict-rules: ~0.12
- roave/security-advisories: dev-master
- slevomat/coding-standard: ^6.0
- squizlabs/php_codesniffer: ^3.5
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');