ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
11 
18 function base()
19 {
20  global $DIC;
21  $f = $DIC['ui.factory'];
22  $r = $DIC['ui.renderer'];
23 
24  $columns = [
25  't1' => $f->table()->column()->text("some text")
26  ];
27 
28  $dummy_records = [
29  ['t1' => 'this is some text'],
30  ['t1' => 'this is some other text']
31  ];
32 
33  $data_retrieval = new class ($dummy_records) implements I\DataRetrieval {
34  protected array $records;
35 
36  public function __construct(array $dummy_records)
37  {
38  $this->records = $dummy_records;
39  }
40 
41  public function getRows(
42  I\DataRowBuilder $row_builder,
43  array $visible_column_ids,
44  Range $range,
45  Order $order,
46  ?array $filter_data,
47  ?array $additional_parameters
48  ): \Generator {
49  foreach ($this->records as $idx => $record) {
50  $row_id = '';
51  yield $row_builder->buildDataRow($row_id, $record);
52  }
53  }
54 
55  public function getTotalRowCount(
56  ?array $filter_data,
57  ?array $additional_parameters
58  ): ?int {
59  return count($this->records);
60  }
61  };
62 
63  $table = $f->table()->data('Text Columns', $columns, $data_retrieval)
64  ->withRequest($DIC->http()->request());
65  return $r->render($table);
66 }
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:12
__construct()
Constructor setup ILIAS global object public.
Definition: class.ilias.php:76
global $DIC
Definition: shib_login.php:25
base()
expected output: > ILIAS shows the rendered Component.
Definition: base.php:18
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28
$r