Свойство | Тип | Описание | |
---|---|---|---|
$messages |
Метод | Описание | |
---|---|---|
__construct ( string $body = '', integer $status = 200, array $headers = [] ) | Constructor | |
addBody ( string $body ) : |
Add to body | |
addHeaders ( array $headers ) : |
Adds headers | |
finalize ( ) : array | Prepares response to be sent | |
getBody ( ) : string | Gets response body | |
getCodeMessage ( integer $code ) : string | Gets the message for the specified HTTP code | |
getContentLength ( ) : number | Gets content length | |
getContentType ( ) : string | Gets content type as header Content-Type value | |
getHeader ( string $name ) : string | Gets specified header | |
getHeaders ( ) : array | Gets all headers | |
getStatus ( ) : number | Gets response status code | |
redirect ( string $url, integer $status = 302 ) : |
Redirect | |
removeHeader ( string $name ) : |
Removes specified header | |
setBody ( string $body ) : |
Sets response body | |
setContentType ( string $type, string $encoding = "utf-8" ) | Sets content MIME type and encoding | |
setHeader ( string $name, string $value ) : |
Sets header | |
setHeaders ( array $headers ) : |
Sets headers | |
setStatus ( integer $status ) : |
Sets status code |
public addHeaders ( array $headers ) : |
||
$headers | array | The response headers |
Результат |
public static getCodeMessage ( integer $code ) : string | ||
$code | integer | |
Результат | string | Returns the message for the specified HTTP code |
public getContentLength ( ) : number | ||
Результат | number | Returns content length |
public getContentType ( ) : string | ||
Результат | string |
public getHeaders ( ) : array | ||
Результат | array | Returns all HTTP headers as array |
public removeHeader ( string $name ) : |
||
$name | string | A header name |
Результат |
public setContentType ( string $type, string $encoding = "utf-8" ) | ||
$type | string | Content MIME type |
$encoding | string | optional Content encoding |
public setHeaders ( array $headers ) : |
||
$headers | array | The response headers looks like array('header-name' => value) |
Результат |