Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
4 | trait ResponseUrlTrait |
||
5 | { |
||
6 | abstract protected function request(); |
||
7 | |||
8 | /** |
||
9 | * Redirect to an application location (Request target). |
||
10 | */ |
||
11 | final protected function redirect($location, $addSuffix = true) |
||
12 | { |
||
13 | $url = $this->request()->getAppUrl(); |
||
14 | $url .= $location; |
||
15 | if ($addSuffix) { |
||
16 | $url .= $this->request()->getSuffix(); |
||
17 | } |
||
18 | return $this->redirectUrl($url); |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * Redirect to the current URL |
||
23 | */ |
||
24 | final protected function reload($removeParameters = []) |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * Redirect to a full URL |
||
32 | */ |
||
33 | final protected function redirectUrl($url) |
||
39 | ); |
||
40 | } |
||
42 |