ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
simpleWithLink.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
34{
35 global $DIC;
36 $factory = $DIC->ui()->factory();
37 $renderer = $DIC->ui()->renderer();
38
39 $icon = $factory->symbol()
40 ->icon()
41 ->standard("crs", 'Example');
42
43 $node1 = $factory->tree()
44 ->node()
45 ->simple('label');
46
47
48 $uri = new \ILIAS\Data\URI('https://ilias.de');
49
50 $node2 = $factory->tree()
51 ->node()
52 ->simple('label', $icon, $uri);
53
54 $data = [['node' => $node1], ['node' => $node2]];
55
56 $recursion = new class () implements \ILIAS\UI\Component\Tree\TreeRecursion {
57 public function getChildren($record, $environment = null): array
58 {
59 return [];
60 }
61
62 public function build(
63 \ILIAS\UI\Component\Tree\Node\Factory $factory,
64 $record,
65 $environment = null
67 return $record['node'];
68 }
69 };
70
71 $tree = $factory->tree()->expandable('Label', $recursion)
72 ->withData($data);
73
74 return $renderer->render([$tree]);
75}
$renderer
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Definition: UI.php:24
This describes a Tree Node.
Definition: Node.php:31
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
global $DIC
Definition: shib_login.php:26