ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
base.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 
34 function base(): string
35 {
36  global $DIC;
37  $f = $DIC->ui()->factory();
38  $r = $DIC->ui()->renderer();
39 
40  $columns = [
41  'l1' => $f->table()->column()->link("a link column")
42  ];
43 
44  $dummy_records = [
45  ['l1' => $f->link()->standard('ILIAS Homepage', 'http://www.ilias.de')],
46  ['l1' => $f->link()->standard('ILIAS Homepage', 'http://www.ilias.de')],
47 
48  ];
49 
50  $data_retrieval = new class ($dummy_records) implements I\DataRetrieval {
51  protected array $records;
52 
53  public function __construct(array $dummy_records)
54  {
55  $this->records = $dummy_records;
56  }
57 
58  public function getRows(
59  I\DataRowBuilder $row_builder,
60  array $visible_column_ids,
61  Range $range,
62  Order $order,
63  ?array $filter_data,
64  ?array $additional_parameters
65  ): \Generator {
66  foreach ($this->records as $idx => $record) {
67  $row_id = '';
68  yield $row_builder->buildDataRow($row_id, $record);
69  }
70  }
71 
72  public function getTotalRowCount(
73  ?array $filter_data,
74  ?array $additional_parameters
75  ): ?int {
76  return count($this->records);
77  }
78  };
79 
80  $table = $f->table()->data($data_retrieval, 'Link Columns', $columns)
81  ->withRequest($DIC->http()->request());
82  return $r->render($table);
83 }
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:28
__construct()
Constructor setup ILIAS global object public.
Definition: class.ilias.php:76
global $DIC
Definition: shib_login.php:22
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28
$r