ILIAS
release_8 Revision v8.24
◀ 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\Section
;
6
7
function
base
()
8
{
9
//Loading factories
10
global
$DIC
;
11
$f
=
$DIC
->ui()->factory();
12
$renderer =
$DIC
->ui()->renderer();
13
$refinery
=
$DIC
->refinery();
14
$request_wrapper
=
$DIC
->http()->wrapper()->query();
15
16
//Some Target magic to get a behaviour closer to some real use case
17
$target =
$DIC
->http()->request()->getRequestTarget();
18
$param
=
"Section"
;
19
$active = 0;
20
if
(
$request_wrapper
->has(
$param
) &&
$request_wrapper
->retrieve(
$param
,
$refinery
->kindlyTo()->int())) {
21
$active =
$request_wrapper
->retrieve(
$param
,
$refinery
->kindlyTo()->int());
22
}
23
24
//Here the real magic to draw the controls
25
$back =
$f
->button()->standard(
"Back"
,
"$target&$param="
. ($active - 1));
26
$next =
$f
->button()->standard(
"Next"
.
" "
. ($active - 1),
"$target&$param="
. ($active + 1));
27
$middle =
$f
->button()->standard(
"Go to Engaged Section (Current Section: $active)"
,
"$target&$param=0"
);
28
//Note that the if the middle button needs to be engaged by the surrounding component, as so, if need to be drawn
29
//as engaged. This can e.g. be the case for rendering a button labeled "Today" or similar.
30
if
($active == 0) {
31
$middle = $middle->withLabel(
"Engaged Section"
)->withEngagedState(
true
);
32
}
33
$view_control_section =
$f
->viewControl()->section($back, $middle, $next);
34
$html = $renderer->render($view_control_section);
35
return
$html;
36
}
$DIC
global $DIC
Definition:
feed.php:28
ILIAS\Repository\$refinery
Refinery Factory $refinery
Definition:
trait.BaseGUIRequest.php:36
ILIAS\UI\examples\Tree\Expandable\$request_wrapper
$request_wrapper
Definition:
expandable_async_repo.php:9
ILIAS\UI\examples\ViewControl\Section
Definition:
base.php:5
ILIAS\UI\examples\ViewControl\Section\base
base()
Definition:
base.php:7
Vendor\Package\$f
$f
Definition:
example_cleaned.php:49
$param
$param
Definition:
xapitoken.php:46
src
UI
examples
ViewControl
Section
base.php
Generated on Sun Nov 2 2025 22:02:02 for ILIAS by
1.9.4 (using
Doxyfile
)