@@ 25-33 (lines=9) @@ | ||
22 | * |
|
23 | * @param string $location |
|
24 | */ |
|
25 | public static function to($location, $query = ""){ |
|
26 | ||
27 | if(!empty($query)){ |
|
28 | $query = '?' . http_build_query((array)$query, null, '&'); |
|
29 | } |
|
30 | ||
31 | $response = new Response('', 302, ["Location" => $location . $query]); |
|
32 | $response->send(); |
|
33 | } |
|
34 | ||
35 | /** |
|
36 | * Redirect to the given location from the root |
|
@@ 40-48 (lines=9) @@ | ||
37 | * |
|
38 | * @param string $location |
|
39 | */ |
|
40 | public static function root($location = "", $query = ""){ |
|
41 | ||
42 | if(!empty($query)){ |
|
43 | $query = '?' . http_build_query((array)$query, null, '&'); |
|
44 | } |
|
45 | ||
46 | $response = new Response('', 302, ["Location" => PUBLIC_ROOT . $location . $query]); |
|
47 | $response->send(); |
|
48 | } |
|
49 | ||
50 | /** |
|
51 | * Redirect to the dashboard |