ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
without_data.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
25 
37 function without_data(): string
38 {
39  global $DIC;
40 
41  $factory = $DIC->ui()->factory();
42  $renderer = $DIC->ui()->renderer();
43 
44  $minimal_mapping = static fn(
45  PresentationRow $row,
46  mixed $record,
47  Factory $ui_factory,
48  mixed $environment
49  ): PresentationRow => $row;
50 
51  $table = $factory->table()->presentation(
52  'Empty Presentation Table',
53  [$factory->viewControl()->mode(['All' => '#'], '')],
54  $minimal_mapping
55  );
56 
57  // Note: this is an optional call, it should merely demonstrate that we have
58  // an empty table.
59  $table->withData([]);
60 
61  return $renderer->render($table);
62 }
$renderer
without_data()
description: > Example showing a presentation table without any data and hence no entries...
This is how the factory for UI elements looks.
Definition: Factory.php:37
global $DIC
Definition: shib_login.php:22
This describes a Row used in Presentation Table.