| 1 | <?php |
||
| 12 | abstract class AbstractController implements ContainerAwareInterface |
||
| 13 | { |
||
| 14 | use ContainerAwareTrait; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Create a new URL |
||
| 18 | * |
||
| 19 | * @param string|null $to |
||
| 20 | * @param array|null $query |
||
| 21 | * @return string |
||
| 22 | */ |
||
| 23 | protected function url(string $to = null, array $query = null): string |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Create a new redirect response |
||
| 30 | * |
||
| 31 | * @param string $to |
||
| 32 | * @param array|null $query |
||
| 33 | * @param bool $permanent |
||
| 34 | * @return ResponseInterface |
||
| 35 | */ |
||
| 36 | protected function redirect(string $to, array $query = null, bool $permanent = false): ResponseInterface |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Create a new response |
||
| 43 | * |
||
| 44 | * @param string|mixed $content |
||
| 45 | * @param int $code |
||
| 46 | * @param array $headers |
||
| 47 | * @return ResponseInterface |
||
| 48 | */ |
||
| 49 | protected function response($content, int $code = 200, array $headers = []): ResponseInterface |
||
| 64 | } |
||
| 65 |