ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
simple.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
7 function simple()
8 {
9  global $DIC;
10  $f = $DIC->ui()->factory();
11  $renderer = $DIC->ui()->renderer();
12 
13  $icon = $f->symbol()->icon()->standard("crs", 'Example');
14 
15  $node1 = $f->tree()->node()->simple('label');
16  $node2 = $f->tree()->node()->simple('label', $icon);
17 
18  $data = [['node' => $node1], ['node' => $node2]];
19 
20  $recursion = new class () implements \ILIAS\UI\Component\Tree\TreeRecursion {
21  public function getChildren($record, $environment = null): array
22  {
23  return [];
24  }
25 
26  public function build(
27  \ILIAS\UI\Component\Tree\Node\Factory $factory,
28  $record,
29  $environment = null
31  return $record['node'];
32  }
33  };
34 
35  $tree = $f->tree()->expandable('Label', $recursion)
36  ->withData($data);
37 
38  return $renderer->render($tree);
39 }
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.
Definition: Node.php:30
global $DIC
Definition: feed.php:28