3 declare(strict_types=1);
10 $f = $DIC->ui()->factory();
11 $renderer = $DIC->ui()->renderer();
13 $getDataNode =
function (
string $label, array $children = []) {
14 return new class ($label, $children) {
15 protected string $label =
'';
16 protected array$children = [];
18 public function __construct(
string $label, array $children = [])
20 $this->label = $label;
21 $this->children = $children;
24 public function getLabel():
string 29 public function getChildren(): array
31 return $this->children;
36 $n11 = $getDataNode(
'1.1');
37 $n12 = $getDataNode(
'1.2', [$getDataNode(
'1.2.1')]);
38 $n1 = $getDataNode(
'1', [$n11, $n12]);
41 $recursion =
new class () implements \
ILIAS\
UI\
Component\Tree\TreeRecursion {
42 public function getChildren($record, $environment = null): array
44 return $record->getChildren();
47 public function build(
52 return $factory->simple($record->getLabel());
56 $tree =
$f->tree()->expandable(
"Label", $recursion)
59 return $renderer->render($tree);
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This describes a Tree Node.
__construct()
Constructor setup ILIAS global object public.