ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
nested.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
7 function nested()
8 {
9  global $DIC;
10  $ui_factory = $DIC['ui.factory'];
11  $renderer = $DIC['ui.renderer'];
12  $tpl = $DIC['tpl'];
13  $tpl->addCss('src/UI/examples/Layout/Alignment/alignment_examples.css');
14 
15  $icon = $ui_factory->image()->standard("templates/default/images/logo/HeaderIconResponsive.svg", "ilias");
16  $blocks = [
17  $ui_factory->legacy('<div class="example_block fullheight blue">Example Block</div>'),
18  $icon,
19  $ui_factory->legacy('<div class="example_block fullheight green">Another Example Block</div>'),
20  $icon,
21  $ui_factory->legacy('<div class="example_block fullheight yellow">And a third block is also part of this group</div>')
22  ];
23 
24  $dynamic = $ui_factory->layout()->alignment()->horizontal()->dynamicallyDistributed(...$blocks);
25  $evenly = $ui_factory->layout()->alignment()->horizontal()->evenlyDistributed(
26  $icon,
27  $icon,
28  $dynamic
29  );
30 
31 
32  $vertical = $ui_factory->layout()->alignment()->vertical(
33  $ui_factory->legacy('<div class="example_block fullheight red">The block above.</div>'),
34  $evenly,
35  $ui_factory->legacy('<div class="example_block fullheight red">The block below.</div>')
36  );
37 
38 
39  return $renderer->render($vertical);
40 }
global $DIC
Definition: feed.php:28