| 1 | <?php |
||
| 9 | class CResponseBasic |
||
| 10 | { |
||
| 11 | use \Anax\DI\TInjectionAware; |
||
| 12 | |||
| 13 | |||
| 14 | /** |
||
| 15 | * Properties |
||
| 16 | * |
||
| 17 | */ |
||
| 18 | private $headers; // Set all headers to send |
||
| 19 | |||
| 20 | |||
| 21 | |||
| 22 | /** |
||
| 23 | * Set headers. |
||
| 24 | * |
||
| 25 | * @param string $header type of header to set |
||
| 26 | * |
||
| 27 | * @return $this |
||
| 28 | */ |
||
| 29 | public function setHeader($header) |
||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | /** |
||
| 37 | * Check if headers are already sent and throw exception if it is. |
||
| 38 | * |
||
| 39 | * @return void |
||
| 40 | * |
||
| 41 | * @throws \Exception |
||
| 42 | */ |
||
| 43 | public function checkIfHeadersAlreadySent() |
||
| 50 | |||
| 51 | |||
| 52 | /** |
||
| 53 | * Send headers. |
||
| 54 | * |
||
| 55 | * @return $this|void |
||
| 56 | * @throws \Exception |
||
| 57 | */ |
||
| 58 | public function sendHeaders() |
||
| 87 | |||
| 88 | |||
| 89 | |||
| 90 | /** |
||
| 91 | * Redirect to another page. |
||
| 92 | * |
||
| 93 | * @param string $url to redirect to |
||
| 94 | * |
||
| 95 | * @return void |
||
| 96 | */ |
||
| 97 | public function redirect($url) |
||
| 104 | } |
||
| 105 |