3 declare(strict_types=1);
10 $f = $DIC->ui()->factory();
11 $renderer = $DIC->ui()->renderer();
13 $icon =
$f->symbol()->icon()->standard(
"crs",
'Example');
14 $long_value =
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, 15 sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquy';
17 $node1 =
$f->tree()->node()->keyValue(
'label',
'value');
18 $node2 =
$f->tree()->node()->keyValue(
'label', $long_value)
19 ->withLink(
new \
ILIAS\Data\
URI(
'https://docu.ilias.de'));
20 $node3 =
$f->tree()->node()->keyValue(
'label',
'value', $icon);
21 $node4 =
$f->tree()->node()->keyValue(
'label',
'value', $icon)
22 ->withLink(
new \
ILIAS\Data\
URI(
'https://docu.ilias.de'));
23 $data = [[
'node' => $node1,
'children' => [
25 [
'node' => $node3,
'children' => [
30 $recursion =
new class () implements \
ILIAS\
UI\
Component\Tree\TreeRecursion {
31 public function getChildren($record, $environment = null): array
33 return $record[
'children'] ?? [];
36 public function build(
41 $node = $record[
'node'];
42 if (isset($record[
'children'])) {
49 $tree =
$f->tree()->expandable(
'Label', $recursion)
52 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.
The scope of this class is split ilias-conform URI's into components.
withExpanded(bool $expanded)
Set $expanded to true to have this node expanded on loading.