ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
_Base.php
Go to the documentation of this file.
1<?php
2//Base example, show-casing how this control is used if firing leads to some
3//Reload of the page
4function _Base()
5{
6 //Loading factories
7 global $DIC;
8 $f = $DIC->ui()->factory();
9 $renderer = $DIC->ui()->renderer();
10
11 //Initializing the options
12 $options = [
13 'default_option' => 'Default Ordering',
14 'latest' => 'Most Recent Ordering',
15 'oldest' => 'Oldest Ordering'
16 ];
17
18 //Note that the selected option needs to be displayed in the label
19 $select_option = 'default_option';
20 if ($_GET['sortation']) {
21 $select_option = $_GET['sortation'];
22 }
23
24 //Generation of the UI Component
25 $s = $f->viewControl()->sortation($options)
26 ->withTargetURL($DIC->http()->request()->getRequestTarget(), 'sortation')
27 ->withLabel($options[$select_option]);
28
29 //Rendering
30 return $renderer->render($s);
31}
_Base()
Definition: _Base.php:4
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
$DIC
Definition: xapitoken.php:46