aleslanger / checkboxtree
Nette 框架的复选框树控件。
v0.02
2018-09-19 08:30 UTC
Requires
- php: >= 5.6
- nette/application: ^2.4
- nette/di: ^2.4
- nette/forms: ^2.4
- nette/http: ^2.4
- nette/utils: ^2.4
This package is auto-updated.
Last update: 2024-09-20 02:44:00 UTC
README
要求
安装
composer require aleslanger/checkboxtree
您可以使用 neon 配置启用此扩展
extensions: CheckBoxTree: aleslanger\Forms\CheckBoxTree\DI\CheckBoxTreeExtension
或将注册到 bootstrap.php 文件中
\aleslanger\Forms\CheckBoxTree\Bridges\ExtensionMethodRegistrator::register();
使用方法
$form = new \Nette\Forms\Form; /* - First |___ - Third - Second */ $items = array( 1 => array('id' => 1, 'title' => 'First', 'parent_id' => ''), 2 => array('id' => 2, 'title' => 'Second', 'parent_id' => ''), 3 => array('id' => 3, 'title' => 'Third', 'parent_id' => 1),); $form->addCheckboxTree("list", "Label", $items);
输入数组必须包含键(id, title, parent_id),key title 是复选框的标签。输出是一个数组,单独的值是 ID。
许可证
MIT 许可证(MIT)