ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
reduce_with.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6
9
29function 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}
Both the subject and the direction need to be specified when expressing an order.
Definition: Order.php:29
$c
Definition: deliver.php:25
$res
Definition: ltiservices.php:69
global $DIC
Definition: shib_login.php:26