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(): string
19 {
20  global $DIC;
21  $f = $DIC->ui()->factory();
22  $r = $DIC->ui()->renderer();
23 
24  $columns = [
25  'l1' => $f->table()->column()->link("a link column")
26  ];
27 
28  $dummy_records = [
29  ['l1' => $f->link()->standard('ILIAS Homepage', 'http://www.ilias.de')],
30  ['l1' => $f->link()->standard('ILIAS Homepage', 'http://www.ilias.de')],
31 
32  ];
33 
34  $data_retrieval = new class ($dummy_records) implements I\DataRetrieval {
35  protected array $records;
36 
37  public function __construct(array $dummy_records)
38  {
39  $this->records = $dummy_records;
40  }
41 
42  public function getRows(
43  I\DataRowBuilder $row_builder,
44  array $visible_column_ids,
45  Range $range,
46  Order $order,
47  ?array $filter_data,
48  ?array $additional_parameters
49  ): \Generator {
50  foreach ($this->records as $idx => $record) {
51  $row_id = '';
52  yield $row_builder->buildDataRow($row_id, $record);
53  }
54  }
55 
56  public function getTotalRowCount(
57  ?array $filter_data,
58  ?array $additional_parameters
59  ): ?int {
60  return count($this->records);
61  }
62  };
63 
64  $table = $f->table()->data('Link Columns', $columns, $data_retrieval)
65  ->withRequest($DIC->http()->request());
66  return $r->render($table);
67 }
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
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28
$r