|
@@ -6,6 +6,11 @@ use Tqdev\PhpCrudApi\Column\ReflectionService;
|
6
|
6
|
|
7
|
7
|
class RequestUtils
|
8
|
8
|
{
|
|
9
|
+ public static function setParams(ServerRequestInterface $request, array $params): ServerRequestInterface
|
|
10
|
+ {
|
|
11
|
+ return $request->withUri($request->getUri()->withQuery(http_build_query($params)));
|
|
12
|
+ }
|
|
13
|
+
|
9
|
14
|
public static function getHeader(ServerRequestInterface $request, string $header): string
|
10
|
15
|
{
|
11
|
16
|
$headers = $request->getHeader($header);
|
|
@@ -16,8 +21,16 @@ class RequestUtils
|
16
|
21
|
{
|
17
|
22
|
$params = array();
|
18
|
23
|
$query = $request->getUri()->getQuery();
|
|
24
|
+ if ($query) {
|
|
25
|
+ die(var_dump($query));
|
|
26
|
+ }
|
|
27
|
+
|
19
|
28
|
$query = str_replace('][]=', ']=', str_replace('=', '[]=', $query));
|
20
|
29
|
parse_str($query, $params);
|
|
30
|
+ if ($params) {
|
|
31
|
+ die(var_dump($params));
|
|
32
|
+ }
|
|
33
|
+
|
21
|
34
|
return $params;
|
22
|
35
|
}
|
23
|
36
|
|