Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions CheckBoxTree.php → CheckboxTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,18 @@ public function getControl() {
return $this->recursiveRender($this->getItems());
}

private function recursiveRender($list) {
$html = Html::el("ul");
private function recursiveRender($list)
{
$html = Html::el('ul');
foreach ($list as $key => $value) {
if (is_array($value)) {
$html->add(Html::el("li")->add($this->recursiveRender($value)));
$html->addHtml(Html::el('li')->addHtml($this->recursiveRender($value)));
} else {
$html->add(Html::el("li")
->add($this->getControlPart($key))
->add(Html::el("label", array("for" => $this->getHtmlId() . '-' . $key))
->add($value)
)
$html->addHtml(Html::el('li')
->addHtml($this->getControlPart($key))
->addHtml(Html::el('label', array('for' => $this->getHtmlId() . '-' . $key))
->addText($value)
)
);
}
}
Expand Down
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"name": "krejcon3/checkboxtree",
"name": "myiyk/checkboxtree",
"description": "easy checkboxtree",
"authors": [
{"name": "Michal Kalita", "email": "kalita.michal@gmail.com"},
{"name": "Ondřej Krejčíř", "email": "krejcon3@gmail.com"}
],
"keywords":["form", "Nette", "input", "checkbox", "checkboxtree", "tree"],
"license": "BSD-3-Clause",
"require": {
"php": ">=5.3.0",
"nette/nette": "~2.0"
"nette/forms": "^2.2",
"nette/utils": "^2.3"
},
"autoload": {
"psr-0": {"krejcon3" : ""}
"psr-4": {"krejcon3\\" : "/"}
}
}