2 declare(strict_types=1);
34 $f = $DIC->ui()->factory();
35 $renderer = $DIC->ui()->renderer();
40 $n1 =
new DataNode(
'1', [$n11, $n12]);
43 $recursion =
new class implements \ILIAS\UI\Component\Tree\TreeRecursion {
44 public function getChildren($record, $environment = null) : array
46 return $record->getChildren();
49 public function build(
50 \ILIAS\UI\Component\Tree\Node\Factory
$factory,
54 return $factory->simple($record->getLabel());
58 $tree =
$f->tree()->expandable(
"Label", $recursion)
61 return $renderer->render($tree);
This describes a Tree Node.
__construct(string $label, array $children=[])