ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
nested.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
19 function nested()
20 {
21  global $DIC;
22  $ui_factory = $DIC['ui.factory'];
23  $renderer = $DIC['ui.renderer'];
24  $tpl = $DIC['tpl'];
25  $tpl->addCss('assets/ui-examples/css/alignment_examples.css');
26 
27 
28  $blocks = [
29  $ui_factory->legacy('<div class="example_block fullheight blue">D</div>'),
30  $ui_factory->legacy('<div class="example_block fullheight green">E</div>'),
31  $ui_factory->legacy('<div class="example_block fullheight yellow">F</div>')
32  ];
33 
34  $aligned = $ui_factory->layout()->alignment()->horizontal()->dynamicallyDistributed(
35  $ui_factory->legacy('<div class="example_block bluedark">A</div>'),
36  $ui_factory->legacy('<div class="example_block greendark">B</div>'),
37  $ui_factory->legacy('<div class="example_block yellowdark">C</div>')
38  );
39 
40  return $renderer->render(
41  $ui_factory->layout()->alignment()->horizontal()
42  ->dynamicallyDistributed(
43  $aligned,
44  ...$blocks
45  )
46  );
47 }
$renderer
global $DIC
Definition: shib_login.php:25
nested()
expected output: > ILIAS shows colored text-blocks labeld A to F.
Definition: nested.php:19