3 declare(strict_types=1);
20 $f = $DIC->ui()->factory();
23 $getDataNode =
function (
string $label, array $children = []) {
24 return new class ($label, $children) {
25 protected string $label =
'';
26 protected array $children = [];
28 public function __construct(
string $label, array $children = [])
30 $this->label = $label;
31 $this->children = $children;
39 public function getChildren(): array
41 return $this->children;
46 $n11 = $getDataNode(
'1.1');
47 $n12 = $getDataNode(
'1.2', [$getDataNode(
'1.2.1')]);
48 $n1 = $getDataNode(
'1', [$n11, $n12]);
52 public function getChildren($record, $environment = null): array
54 return $record->getChildren();
57 public function build(
61 ): \ILIAS\UI\Component\Tree\Node\Node {
62 return $factory->simple($record->getLabel());
66 $tree =
$f->tree()->expandable(
"Label", $recursion)
Interface Observer Contains several chained tasks and infos about them.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This is how the factory for UI elements looks.
__construct()
Constructor setup ILIAS global object public.
expandable2()
description: > Example for rendering an expandable tree.