ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
reduce_with.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
9 
29 function reduce_with()
30 {
31  global $DIC;
32  $f = $DIC->ui()->factory();
33  $r = $DIC->ui()->renderer();
34 
35  $vcs = [
36  $f->input()->viewControl()->pagination(),
37  $f->input()->viewControl()->sortation([
38  'Field 1, ascending' => new Order('field1', 'ASC'),
39  'Field 1, descending' => new Order('field1', 'DESC'),
40  'Field 2, descending' => new Order('field2', 'ASC')
41  ]),
42  $f->input()->viewControl()->fieldSelection([
43  'field1' => 'Feld 1',
44  'field2' => 'Feld 2'
45  ], 'shown columns', 'apply'),
46  ];
47 
48  $vc_container = $f->input()->container()->viewControl()->standard($vcs);
49 
50  $array = $vc_container->reduceWith(
51  fn($c, $res) => [$c->getCanonicalName() => $res]
52  );
53 
54  return $r->render([
55  $f->legacy()->content('<pre>' . print_r(json_encode($array, JSON_PRETTY_PRINT), true) . '</pre>')
56  ]);
57 }
$res
Definition: ltiservices.php:66
$c
Definition: deliver.php:25
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:28
global $DIC
Definition: shib_login.php:26
reduce_with()
expected output: > ILIAS shows a JSON like that: { "Standard View Control Container Input": [ { "Pag...
Definition: reduce_with.php:29
$r