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