ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
nested.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
35 function nested()
36 {
37  global $DIC;
38  $ui_factory = $DIC['ui.factory'];
39  $renderer = $DIC['ui.renderer'];
40  $tpl = $DIC['tpl'];
41  $tpl->addCss('assets/ui-examples/css/alignment_examples.css');
42 
43 
44  $blocks = [
45  $ui_factory->legacy()->content('<div class="example_block fullheight blue">D</div>'),
46  $ui_factory->legacy()->content('<div class="example_block fullheight green">E</div>'),
47  $ui_factory->legacy()->content('<div class="example_block fullheight yellow">F</div>')
48  ];
49 
50  $aligned = $ui_factory->layout()->alignment()->horizontal()->dynamicallyDistributed(
51  $ui_factory->legacy()->content('<div class="example_block bluedark">A</div>'),
52  $ui_factory->legacy()->content('<div class="example_block greendark">B</div>'),
53  $ui_factory->legacy()->content('<div class="example_block yellowdark">C</div>')
54  );
55 
56  return $renderer->render(
57  $ui_factory->layout()->alignment()->horizontal()
58  ->dynamicallyDistributed(
59  $aligned,
60  ...$blocks
61  )
62  );
63 }
$renderer
global $DIC
Definition: shib_login.php:22
nested()
expected output: > ILIAS shows colored text-blocks labeld A to F.
Definition: nested.php:35