ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ 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\Section
;
22
36
function
base
()
37
{
38
//Loading factories
39
global
$DIC
;
40
$f
=
$DIC
->ui()->factory();
41
$renderer
=
$DIC
->ui()->renderer();
42
$refinery
=
$DIC
->refinery();
43
$request_wrapper
=
$DIC
->http()->wrapper()->query();
44
45
//Some Target magic to get a behaviour closer to some real use case
46
$target =
$DIC
->http()->request()->getRequestTarget();
47
$param
=
"Section"
;
48
$active = 0;
49
if
(
$request_wrapper
->has(
$param
) &&
$request_wrapper
->retrieve(
$param
,
$refinery
->kindlyTo()->int())) {
50
$active =
$request_wrapper
->retrieve(
$param
,
$refinery
->kindlyTo()->int());
51
}
52
53
//Here the real magic to draw the controls
54
$back =
$f
->button()->standard(
"Back"
,
"$target&$param="
. ($active - 1));
55
$next =
$f
->button()->standard(
"Next"
.
" "
. ($active - 1),
"$target&$param="
. ($active + 1));
56
$middle =
$f
->button()->standard(
"Go to Engaged Section (Current Section: $active)"
,
"$target&$param=0"
);
57
//Note that the if the middle button needs to be engaged by the surrounding component, as so, if need to be drawn
58
//as engaged. This can e.g. be the case for rendering a button labeled "Today" or similar.
59
if
($active == 0) {
60
$middle = $middle->withLabel(
"Engaged Section"
)->withEngagedState(
true
);
61
}
62
$view_control_section =
$f
->viewControl()->section($back, $middle, $next);
63
$html =
$renderer
->render($view_control_section);
64
return
$html;
65
}
$renderer
$renderer
Definition:
build_bootstrap.php:83
ILIAS\UI\examples\Layout\Page\Standard\$request_wrapper
$request_wrapper
Definition:
ui.php:136
ILIAS\UI\examples\Layout\Page\Standard\$refinery
$refinery
Definition:
ui.php:137
ILIAS\UI\examples\ViewControl\Section
Definition:
base.php:21
ILIAS\UI\examples\ViewControl\Section\base
base()
Definition:
base.php:36
Vendor\Package\$f
$f
Definition:
example_cleaned.php:49
$DIC
global $DIC
Definition:
shib_login.php:26
$param
$param
Definition:
xapitoken.php:46
components
ILIAS
UI
src
examples
ViewControl
Section
base.php
Generated on Sat Oct 18 2025 23:04:40 for ILIAS by
1.9.4 (using
Doxyfile
)