프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$httpStatuses | An array of http status codes by RFC2616 standard or some other if noted by comment. |
메소드 | 설명 | |
---|---|---|
__construct ( string $content = '', integer $statusCode = 200, array $headers = [] ) | Constructs the Response object. | |
cacheControl ( ) : |
Get access to cache control headers. | |
create ( string $content = '', integer $statusCode = 200, array $headers = [] ) : |
Static constructor. | |
getCharset ( ) : string | Returns currently set response charset. | |
getContent ( ) : string | Get response content. | |
getContentType ( ) : string | Returns the currently set content type. | |
getHeaders ( ) : array | Returns an array of current headers. | |
getStatusCode ( ) : integer | Returns current status code. | |
send ( ) | Sends both the headers and the content to the browser. | |
sendContent ( ) | Sends the content to the browser. | |
sendHeaders ( ) | Send the currently defined headers. | |
setAsNotModified ( ) | Sets the response as not modified. | |
setCharset ( string $charset ) | Set the response charset. | |
setContent ( string $content ) | Set response content. | |
setContentType ( string $contentType ) | Sets the Content-Type header value. | |
setHeader ( string $key, string $value ) | Sets or adds a header. | |
setStatusCode ( integer $statusCode, string $message = '' ) | Set HTTP response status code. The status code must be a valid HTTP status code, or an exception will be thrown. |
public __construct ( string $content = '', integer $statusCode = 200, array $headers = [] ) | ||
$content | string | Content that will be attached to the response. |
$statusCode | integer | HTTP status code that will be sent back to the user. |
$headers | array | Additional headers that should be attached to the response. |
public cacheControl ( ) : |
||
리턴 |
public static create ( string $content = '', integer $statusCode = 200, array $headers = [] ) : |
||
$content | string | Content that will be attached to the response. |
$statusCode | integer | HTTP status code that will be sent back to the user. |
$headers | array | Additional headers that should be attached to the response. |
리턴 |
public getCharset ( ) : string | ||
리턴 | string |
public getContentType ( ) : string | ||
리턴 | string |
public setCharset ( string $charset ) | ||
$charset | string | Charset name. |
public setContent ( string $content ) | ||
$content | string | Response content. |
public setContentType ( string $contentType ) | ||
$contentType | string |
public setStatusCode ( integer $statusCode, string $message = '' ) | ||
$statusCode | integer | Http status code. |
$message | string | Http status message. If not set we will use the default message by RFC2616. |