45 ?array $passed_query_params = null,
46 ?array $passed_post_data = null
59 $t = $this->
refinery->kindlyTo()->int();
60 return (
int) ($this->
get(
$key, $t) ?? 0);
72 $t = $this->
refinery->custom()->transformation(
73 static function (array $arr): array {
75 return array_map(
'intval', $arr);
78 return (array) ($this->
get(
$key, $t) ?? []);
84 protected function str(
string $key): string
86 $t = $this->
refinery->kindlyTo()->string();
87 return \ilUtil::stripSlashes((
string) ($this->
get($key, $t) ??
""));
99 $t = $this->
refinery->custom()->transformation(
100 static function (array $arr): array {
103 static function ($v):
string {
104 return \ilUtil::stripSlashes((
string) $v);
110 return (array) ($this->
get(
$key, $t) ?? []);
118 $t = $this->
refinery->kindlyTo()->bool();
119 return (
bool) ($this->
get(
$key, $t) ??
false);
131 $t = $this->
refinery->custom()->transformation(
132 static function (array $arr): array {
134 return array_map(
'boolval', $arr);
137 return (array) ($this->
get(
$key, $t) ?? []);
145 if ($this->passed_query_params === null && $this->passed_post_data === null) {
146 $no_transform = $this->
refinery->identity();
147 $w = $this->
http->wrapper();
148 if ($w->post()->has($key)) {
149 return is_array($w->post()->retrieve($key, $no_transform));
151 if ($w->query()->has($key)) {
152 return is_array($w->query()->retrieve($key, $no_transform));
155 if (isset($this->passed_post_data[$key])) {
156 return is_array($this->passed_post_data[$key]);
158 if (isset($this->passed_query_params[$key])) {
159 return is_array($this->passed_query_params[$key]);
169 protected function get(
string $key, Refinery\Transformation $t)
171 if ($this->passed_query_params === null && $this->passed_post_data === null) {
172 $w = $this->
http->wrapper();
173 if ($w->post()->has($key)) {
174 return $w->post()->retrieve($key, $t);
176 if ($w->query()->has($key)) {
177 return $w->query()->retrieve($key, $t);
180 if (isset($this->passed_post_data[$key])) {
181 return $t->transform($this->passed_post_data[$key]);
183 if (isset($this->passed_query_params[$key])) {
184 return $t->transform($this->passed_query_params[$key]);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(HTTP\Services $http, Refinery\Factory $refinery, ?array $passed_query_params=null, ?array $passed_post_data=null)
Query params and post data parameters are used for testing.
intArray(string $key)
get integer array kindly
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Skill gui global request wrapper.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Refinery Factory $refinery
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
boolArray(string $key)
get bool array kindly
str(string $key)
get string parameter kindly
isArray(string $key)
Check if parameter is an array.
int(string $key)
get integer parameter kindly
array $passed_query_params
strArray(string $key)
get string array kindly
bool(string $key)
get bool parameter kindly
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...