ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
base.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\UI\examples\ViewControl\Mode
;
22
34
function
base
()
35
{
36
//Loading factories
37
global
$DIC
;
38
$f
= $DIC->ui()->factory();
39
$renderer
= $DIC->ui()->renderer();
40
$refinery
= $DIC->refinery();
41
$request_wrapper
= $DIC->http()->wrapper()->query();
42
43
//Some Target magic to get a behaviour closer to some real use case
44
$target = $DIC->http()->request()->getRequestTarget();
45
$param
=
"Mode"
;
46
47
$active = 1;
48
if
(
$request_wrapper
->has(
$param
) &&
$request_wrapper
->retrieve(
$param
,
$refinery
->kindlyTo()->int())) {
49
$active =
$request_wrapper
->retrieve(
$param
,
$refinery
->kindlyTo()->int());
50
}
51
52
//Here the real magic to draw the controls
53
$actions = array(
54
"$param 1"
=>
"$target&$param=1"
,
55
"$param 2"
=>
"$target&$param=2"
,
56
"$param 3"
=>
"$target&$param=3"
,
57
);
58
59
$aria_label =
"change_the_currently_displayed_mode"
;
60
$view_control =
$f
->viewControl()->mode($actions, $aria_label)->withActive(
"$param $active"
);
61
$html =
$renderer
->render($view_control);
62
63
return
$html;
64
}
ILIAS\UI\examples\Layout\Page\Standard\$refinery
$refinery
Definition:
ui.php:137
$renderer
$renderer
Definition:
build_bootstrap.php:83
ILIAS\UI\examples\ViewControl\Mode
Definition:
base.php:21
ILIAS\UI\examples\ViewControl\Mode\base
base()
description: > Base example performing a page reload if active view is changed.
Definition:
base.php:34
ILIAS\UI\examples\Layout\Page\Standard\$request_wrapper
$request_wrapper
Definition:
ui.php:136
Vendor\Package\$f
$f
Definition:
example_cleaned.php:49
$param
$param
Definition:
xapitoken.php:46
$DIC
global $DIC
Definition:
shib_login.php:26
components
ILIAS
UI
src
examples
ViewControl
Mode
base.php
Generated on Sun Aug 31 2025 23:04:09 for ILIAS by
1.8.13 (using
Doxyfile
)