ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
◀ ilDoc Overview
base.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
ILIAS\UI\examples\ViewControl\Mode
;
6
18
function
base
()
19
{
20
//Loading factories
21
global
$DIC
;
22
$f
= $DIC->ui()->factory();
23
$renderer
= $DIC->ui()->renderer();
24
$refinery
= $DIC->refinery();
25
$request_wrapper
= $DIC->http()->wrapper()->query();
26
27
//Some Target magic to get a behaviour closer to some real use case
28
$target = $DIC->http()->request()->getRequestTarget();
29
$param
=
"Mode"
;
30
31
$active = 1;
32
if
(
$request_wrapper
->has(
$param
) &&
$request_wrapper
->retrieve(
$param
,
$refinery
->kindlyTo()->int())) {
33
$active =
$request_wrapper
->retrieve(
$param
,
$refinery
->kindlyTo()->int());
34
}
35
36
//Here the real magic to draw the controls
37
$actions = array(
38
"$param 1"
=>
"$target&$param=1"
,
39
"$param 2"
=>
"$target&$param=2"
,
40
"$param 3"
=>
"$target&$param=3"
,
41
);
42
43
$aria_label =
"change_the_currently_displayed_mode"
;
44
$view_control =
$f
->viewControl()->mode($actions, $aria_label)->withActive(
"$param $active"
);
45
$html =
$renderer
->render($view_control);
46
47
return
$html;
48
}
ILIAS\UI\examples\Layout\Page\Standard\$refinery
$refinery
Definition:
ui.php:121
$renderer
$renderer
Definition:
build_bootstrap.php:83
ILIAS\UI\examples\ViewControl\Mode
Definition:
base.php:5
ILIAS\UI\examples\ViewControl\Mode\base
base()
description: > Base example performing a page reload if active view is changed.
Definition:
base.php:18
ILIAS\UI\examples\Layout\Page\Standard\$request_wrapper
$request_wrapper
Definition:
ui.php:120
Vendor\Package\$f
$f
Definition:
example_cleaned.php:49
$param
$param
Definition:
xapitoken.php:44
$DIC
global $DIC
Definition:
shib_login.php:25
components
ILIAS
UI
src
examples
ViewControl
Mode
base.php
Generated on Wed Sep 10 2025 15:16:44 for ILIAS by
1.8.13 (using
Doxyfile
)