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 
11 use Generator;
12 
23 function without_data(): string
24 {
25  global $DIC;
26 
27  $factory = $DIC->ui()->factory();
28  $renderer = $DIC->ui()->renderer();
29  $request = $DIC->http()->request();
30 
31  $empty_retrieval = new class () implements DataRetrieval {
32  public function getRows(
33  DataRowBuilder $row_builder,
34  array $visible_column_ids,
35  Range $range,
36  Order $order,
37  ?array $filter_data,
38  ?array $additional_parameters
39  ): Generator {
40  yield from [];
41  }
42 
43  public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int
44  {
45  return 0;
46  }
47  };
48 
49  $table = $factory->table()->data(
50  'Empty Data Table',
51  [
52  'col1' => $factory->table()->column()->text('Column 1')
53  ->withIsSortable(false),
54  'col2' => $factory->table()->column()->number('Column 2')
55  ->withIsSortable(false),
56  ],
57  $empty_retrieval
58  );
59 
60  return $renderer->render($table->withRequest($request));
61 }
$renderer
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:12
global $DIC
Definition: shib_login.php:25
without_data()
description: > Example showing a data table without any data and hence no entries, which will automatically display an according message.
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28