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 
19 function _Base()
20 {
21  //Load factories
22  global $DIC;
23  $f = $DIC->ui()->factory();
24  $renderer = $DIC->ui()->renderer();
25  $refinery = $DIC->refinery();
26  $request_wrapper = $DIC->http()->wrapper()->query();
27 
28  //Initialize options
29  $options = [
30  'default_option' => 'Default',
31  'latest' => 'Most Recent',
32  'oldest' => 'Oldest'
33  ];
34 
35  //Note that the selected option needs to be displayed in the label
36  $select_option = 'default_option';
37  if ($request_wrapper->has('sortation') && $request_wrapper->retrieve('sortation', $refinery->kindlyTo()->string())) {
38  $select_option = $request_wrapper->retrieve('sortation', $refinery->kindlyTo()->string());
39  }
40 
41  //Generate the UI Component
42  $s = $f->viewControl()->sortation($options, $select_option)
43  ->withTargetURL($DIC->http()->request()->getRequestTarget(), 'sortation');
44 
45  //Rendering
46  return $renderer->render($s);
47 }
$renderer
global $DIC
Definition: shib_login.php:25
_Base()
description: > Base example, show-casing how this control is used if firing leads to some reload of ...
Definition: _Base.php:19