Свойство | Type | Description | |
---|---|---|---|
$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 |
Méthode | Description | |
---|---|---|
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 |
Méthode | Description | |
---|---|---|
sendCookies ( ) : void | Process Cookies to Header |
public addHeaders ( array $headers ) : void | ||
$headers | array | Associative array of headers to add to the message |
Résultat | void |
public getBody ( ) : |
||
Résultat |
public getHeaderAsArray ( string $header ) : string[] | ||
$header | string | Case-insensitive header name. |
Résultat | string[] |
public getHeaders ( ) : array | ||
Résultat | array | returns an associative array of the message's headers. |
public getProtocolVersion ( ) : string | ||
Résultat | string | HTTP protocol version. |
public getReasonPhrase ( ) : string | null | ||
Résultat | string | null | reason phrase, or null if unknown. |
public getStatusCode ( ) : integer | ||
Résultat | integer | status code. |
public removeHeader ( string $header ) : void | ||
$header | string | HTTP header to remove |
Résultat | void |
protected sendCookies ( ) : void | ||
Résultat | 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 | |
Résultat | void |
public setHeaders ( array $headers ) : void | ||
$headers | array | Headers to set. |
Résultat | 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. |
Résultat | void |
public switchType ( $type ) | ||
$type |