ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
QueryParamsFromServerRequest.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 2019 Thomas Famula <famula@leifos.de> Extended GPL, see docs/LICENSE */
4
5
namespace
ILIAS\UI\Implementation\Component\Input\Container
;
6
7
use
ILIAS\UI\Implementation\Component\Input\InputData
;
8
use
Psr\Http\Message\ServerRequestInterface
;
9
14
class
QueryParamsFromServerRequest
implements
InputData
15
{
16
20
protected
$query_params
;
21
22
23
public
function
__construct
(ServerRequestInterface $request)
24
{
25
$this->query_params = $request->getQueryParams();
26
}
27
28
32
public
function
get
(
$name
)
33
{
34
if
(!isset($this->query_params[
$name
])) {
35
throw
new \LogicException(
"'$name' is not contained in query parameters."
);
36
}
37
38
return
$this->query_params[
$name
];
39
}
40
41
45
public
function
getOr
(
$name
, $default)
46
{
47
if
(!isset($this->query_params[
$name
])) {
48
return
$default;
49
}
50
51
return
$this->query_params[
$name
];
52
}
53
}
InputData
ILIAS\UI\Implementation\Component\Input\InputData
Describes how Input-Elements want to interact with posted data.
Definition:
InputData.php:12
ServerRequestInterface
$name
if($format !==null) $name
Definition:
metadata.php:230
ILIAS\UI\Implementation\Component\Input\Container\QueryParamsFromServerRequest\$query_params
$query_params
Definition:
QueryParamsFromServerRequest.php:20
ILIAS\UI\Implementation\Component\Input\Container\QueryParamsFromServerRequest\__construct
__construct(ServerRequestInterface $request)
Definition:
QueryParamsFromServerRequest.php:23
ILIAS\UI\Implementation\Component\Input\Container
Definition:
Factory.php:5
ILIAS\UI\Implementation\Component\Input\Container\QueryParamsFromServerRequest
Implements interaction of input element with get data from psr-7 server request.
Definition:
QueryParamsFromServerRequest.php:14
ILIAS\UI\Implementation\Component\Input\Container\QueryParamsFromServerRequest\getOr
getOr($name, $default)
Definition:
QueryParamsFromServerRequest.php:45
src
UI
Implementation
Component
Input
Container
QueryParamsFromServerRequest.php
Generated on Sun Aug 31 2025 21:01:41 for ILIAS by
1.8.13 (using
Doxyfile
)