ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
base.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 
34 function base()
35 {
36  global $DIC;
37  $f = $DIC['ui.factory'];
38  $r = $DIC['ui.renderer'];
39 
40  $columns = [
41  't1' => $f->table()->column()->status("status")
42  ];
43 
44  $data_retrieval = new class () implements I\DataRetrieval {
45  protected array $records = [
46  ['t1' => 'unknown'],
47  ['t1' => 'incomplete'],
48  ['t1' => 'failed'],
49  ['t1' => 'passed'],
50  ['t1' => 'completed']
51  ];
52 
53  public function getRows(
54  I\DataRowBuilder $row_builder,
55  array $visible_column_ids,
56  Range $range,
57  Order $order,
58  ?array $filter_data,
59  ?array $additional_parameters
60  ): \Generator {
61  foreach ($this->records as $idx => $record) {
62  $row_id = '';
63  yield $row_builder->buildDataRow($row_id, $record);
64  }
65  }
66 
67  public function getTotalRowCount(
68  ?array $filter_data,
69  ?array $additional_parameters
70  ): ?int {
71  return count($this->records);
72  }
73  };
74 
75  $table = $f->table()->data($data_retrieval, 'Status Columns', $columns)
76  ->withRequest($DIC->http()->request());
77  return $r->render($table);
78 }
base()
expected output: > ILIAS shows the rendered Component.
Definition: base.php:34
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:28
global $DIC
Definition: shib_login.php:26
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28
$r