19 declare(strict_types=1);
36 $f = $DIC->ui()->factory();
39 $getDataNode =
function (
string $label, array $children = []) {
40 return new class ($label, $children) {
41 protected string $label =
'';
42 protected array $children = [];
44 public function __construct(
string $label, array $children = [])
46 $this->label = $label;
47 $this->children = $children;
55 public function getChildren(): array
57 return $this->children;
62 $n11 = $getDataNode(
'1.1');
63 $n12 = $getDataNode(
'1.2', [$getDataNode(
'1.2.1')]);
64 $n1 = $getDataNode(
'1', [$n11, $n12]);
68 public function getChildren($record, $environment =
null): array
70 return $record->getChildren();
73 public function build(
77 ): \ILIAS\UI\Component\Tree\Node\Node {
78 return $factory->simple($record->getLabel());
82 $tree =
$f->tree()->expandable(
"Label", $recursion)
Interface Observer Contains several chained tasks and infos about them.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct()
Constructor setup ILIAS global object public.
expandable2()
description: > Example for rendering an expandable tree.