Response
class Response
HTTP response.
Constants
DEFAULT_STATUS |
Default status code. |
Properties
protected Request | $request | Request instance. | |
protected mixed | $body | Response body. | |
protected string | $contentType | Response content type. | |
protected string | $charset | Response charset. | |
protected int | $statusCode | Status code. | |
protected Headers | $headers | Response headers. | |
protected Cookies | $cookies | Cookies. | |
protected bool | $outputCompression | Compress output? | |
protected bool | $responseCache | Enable response cache? | |
protected array | $statusCodes | HTTP status codes. |
Methods
Returns the response body.
Returns the response content type.
Returns the response charset.
Returns the HTTP status code.
Returns response header collection.
Returns response cookie collection.
Sends response headers.
Disables ETag response cache.
Disables output compression.
Send output to browser.
Details
at line 203
__construct(Request $request, string $charset = 'UTF-8', Signer $signer = null)
Constructor.
at line 220
Response
body(mixed $body)
Sets the response body.
at line 232
mixed
getBody()
Returns the response body.
at line 242
Response
clearBody()
Clears the response body.
at line 256
Response
type(string $contentType, string $charset = null)
Sets the response content type.
at line 273
string
getType()
Returns the response content type.
at line 284
Response
charset(string $charset)
Sets the response charset.
at line 296
string
getCharset()
Returns the response charset.
at line 307
Response
status(int $statusCode)
Sets the HTTP status code.
at line 322
int
getStatus()
Returns the HTTP status code.
at line 332
Headers
getHeaders()
Returns response header collection.
at line 342
Cookies
getCookies()
Returns response cookie collection.
at line 352
Response
clear()
Clears the response body, cookies and headers.
at line 368
Response
reset()
Resets the response.
at line 378
sendHeaders()
Sends response headers.
at line 427
Response
cache()
Enables ETag response cache.
at line 439
Response
disableCaching()
Disables ETag response cache.
at line 451
Response
compress()
Enables output compression.
at line 463
Response
disableCompression()
Disables output compression.
at line 473
send()
Send output to browser.