1 | <?php |
||
2 | /** |
||
3 | * Controller commands |
||
4 | * User: moyo |
||
5 | * Date: 2018/6/11 |
||
6 | * Time: 10:14 AM |
||
7 | */ |
||
8 | |||
9 | namespace Carno\Web\Chips\Controller; |
||
10 | |||
11 | use Carno\HTTP\Standard\Response; |
||
12 | |||
13 | trait Commands |
||
14 | { |
||
15 | /** |
||
16 | * @param string $target |
||
17 | * @param bool $permanently |
||
18 | * @return Response |
||
19 | */ |
||
20 | final public function redirect(string $target, bool $permanently = false) : Response |
||
21 | { |
||
22 | return $this->response = new Response($permanently ? 301 : 302, ['Location' => $target]); |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
23 | } |
||
24 | } |
||
25 |