ILIAS  release_8 Revision v8.23
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
11 
12 function base(): string
13 {
14  global $DIC;
15  $f = $DIC->ui()->factory();
16  $r = $DIC->ui()->renderer();
17 
18  $columns = [
19  'l1' => $f->table()->column()->link("a link column")
20  ];
21 
22  $dummy_records = [
23  ['l1' => $f->link()->standard('ILIAS Homepage', 'http://www.ilias.de')],
24  ['l1' => $f->link()->standard('ILIAS Homepage', 'http://www.ilias.de')],
25 
26  ];
27 
28  $data_retrieval = new class ($dummy_records) implements I\DataRetrieval {
29  protected array $records;
30 
31  public function __construct(array $dummy_records)
32  {
33  $this->records = $dummy_records;
34  }
35 
36  public function getRows(
37  I\DataRowBuilder $row_builder,
38  array $visible_column_ids,
39  Range $range,
40  Order $order,
41  ?array $filter_data,
42  ?array $additional_parameters
43  ): \Generator {
44  foreach ($this->records as $idx => $record) {
45  $row_id = '';
46  yield $row_builder->buildDataRow($row_id, $record);
47  }
48  }
49 
50  public function getTotalRowCount(
51  ?array $filter_data,
52  ?array $additional_parameters
53  ): ?int {
54  return count($this->records);
55  }
56  };
57 
58  $table = $f->table()->data('Link Columns', $columns, $data_retrieval)
59  ->withRequest($DIC->http()->request());
60  return $r->render($table);
61 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:12
global $DIC
Definition: feed.php:28
__construct()
Constructor setup ILIAS global object public.
Definition: class.ilias.php:62
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A simple class to express a range of whole positive numbers.
Definition: Range.php:30