Свойство | Тип | Описание | |
---|---|---|---|
$body | result can be Controller|Layout | ||
$code | response code equal to HTTP status codes | ||
$cookies | list of cookies | ||
$headers | list of headers | ||
$phrase | HTTP Phrase | ||
$protocol | HTTP protocol version | ||
$type | CLI|HTML|JSON |
Метод | Описание | |
---|---|---|
addHeader ( string $header, string $value ) : void | Appends a header value for the specified header | |
addHeaders ( array $headers ) : void | Merges in an associative array of headers. | |
clearBody ( ) : void | Clear response body | |
getBody ( ) : |
Get response body | |
getCookie ( string $name ) : array | null | Get Cookie by name | |
getHeader ( string $header ) : string | Retrieve a header by the given case-insensitive name as a string | |
getHeaderAsArray ( string $header ) : string[] | Retrieves a header by the given case-insensitive name as an array of strings | |
getHeaders ( ) : array | Gets all message headers | |
getProtocolVersion ( ) : string | Gets the HTTP protocol version as a string | |
getReasonPhrase ( ) : string | null | Gets the response Reason-Phrase, a short textual description of the Status-Code | |
getStatusCode ( ) : integer | Gets the response Status-Code | |
hasHeader ( string $header ) : boolean | Checks if a header exists by the given case-insensitive name | |
removeHeader ( string $header ) : void | Remove a specific header by case-insensitive name. | |
removeHeaders ( ) : void | Remove all headers | |
send ( ) | send | |
setBody ( mixed $body ) : void | Set response body | |
setCookie ( string $name, string $value = '', integer | string | DateTime $expire, string $path = '/', string $domain = '', boolean $secure = false, boolean $httpOnly = false ) : void | Set Cookie | |
setHeader ( string $header, string | string[] $value ) : void | Sets a header, replacing any existing values of any headers with the same case-insensitive name | |
setHeaders ( array $headers ) : void | Sets headers, replacing any headers that have already been set on the message | |
setReasonPhrase ( string $phrase ) | Sets the Reason-Phrase of the response | |
setStatusCode ( integer $code ) : void | Sets the status code of this response | |
switchType ( $type ) | Set Response Type, one of JSON, HTML or CLI |
Метод | Описание | |
---|---|---|
sendCookies ( ) : void | Process Cookies to Header |
public addHeaders ( array $headers ) : void | ||
$headers | array | Associative array of headers to add to the message |
Результат | void |
public getBody ( ) : |
||
Результат |
public getHeaderAsArray ( string $header ) : string[] | ||
$header | string | Case-insensitive header name. |
Результат | string[] |
public getHeaders ( ) : array | ||
Результат | array | returns an associative array of the message's headers. |
public getProtocolVersion ( ) : string | ||
Результат | string | HTTP protocol version. |
public getReasonPhrase ( ) : string | null | ||
Результат | string | null | reason phrase, or null if unknown. |
public getStatusCode ( ) : integer | ||
Результат | integer | status code. |
public removeHeader ( string $header ) : void | ||
$header | string | HTTP header to remove |
Результат | void |
protected sendCookies ( ) : void | ||
Результат | void |
public setCookie ( string $name, string $value = '', integer | string | DateTime $expire, string $path = '/', string $domain = '', boolean $secure = false, boolean $httpOnly = false ) : void | ||
$name | string | |
$value | string | |
$expire | integer | string | DateTime | |
$path | string | |
$domain | string | |
$secure | boolean | |
$httpOnly | boolean | |
Результат | void |
public setHeaders ( array $headers ) : void | ||
$headers | array | Headers to set. |
Результат | void |
public setReasonPhrase ( string $phrase ) | ||
$phrase | string | the Reason-Phrase to set. |
public setStatusCode ( integer $code ) : void | ||
$code | integer | the 3-digit integer result code to set. |
Результат | void |
public switchType ( $type ) | ||
$type |