ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
without_data.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
9 
21 function without_data(): string
22 {
23  global $DIC;
24 
25  $factory = $DIC->ui()->factory();
26  $renderer = $DIC->ui()->renderer();
27 
28  $minimal_mapping = static fn(
29  PresentationRow $row,
30  mixed $record,
31  Factory $ui_factory,
32  mixed $environment
33  ): PresentationRow => $row;
34 
35  $table = $factory->table()->presentation(
36  'Empty Presentation Table',
37  [$factory->viewControl()->mode(['All' => '#'], '')],
38  $minimal_mapping
39  );
40 
41  // Note: this is an optional call, it should merely demonstrate that we have
42  // an empty table.
43  $table->withData([]);
44 
45  return $renderer->render($table);
46 }
$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:25
This describes a Row used in Presentation Table.