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