stopka / nette-forms-checkbox-component
带有标签部分的标题的 Nette 表单复选框组件。
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 组件,可以在标签部分设置标题,就像其他表单控件一样。
用法
标签将像常规复选框一样在输入旁边渲染,标题将渲染在表单的“标签”部分(通常在左侧)。
$form = new Form(); $form['checkbox'] = (new CheckboxControl('Some label'))->setCaption('Some caption');
可选地,向您的表单添加属性
class MyForm extends Form{ use CheckboxControlContainerTrait; } $form = new MyForm(); $form->addExtendedCheckbox('checkbox', 'Some label') ->setCaption('Some caption');