Property | Type | Description | |
---|---|---|---|
$headers | |||
$statusTexts | array | The list of codes is complete according to the {@link http://www.iana.org/assignments/http-status-codes/ Hypertext Transfer Protocol (HTTP) Status Code Registry} (last updated 2016-03-01). Unless otherwise noted, the status code is defined in RFC2616. |
Property | Type | Description | |
---|---|---|---|
$charset | string | ||
$content | string | ||
$statusCode | integer | ||
$statusText | string | ||
$version | string |
Method | Description | |
---|---|---|
__clone ( ) | Clones the current Response instance. | |
__construct ( mixed $content = '', integer $status = 200, array $headers = [] ) | Constructor. | |
__toString ( ) : string | Returns the Response as an HTTP string. | |
closeOutputBuffers ( integer $targetLevel, boolean $flush ) | Cleans or flushes output buffers up to target level. | |
create ( mixed $content = '', integer $status = 200, array $headers = [] ) : |
Factory method for chainability. | |
expire ( ) : |
Marks the response stale by setting the Age header to be equal to the maximum age of the response. | |
getAge ( ) : integer | Returns the age of the response. | |
getCharset ( ) : string | Retrieves the response charset. | |
getContent ( ) : string | Gets the current response content. | |
getDate ( ) : DateTime | Returns the Date header as a DateTime instance. | |
getEtag ( ) : string | null | Returns the literal value of the ETag HTTP header. | |
getExpires ( ) : DateTime | null | Returns the value of the Expires header as a DateTime instance. | |
getLastModified ( ) : DateTime | null | Returns the Last-Modified HTTP header as a DateTime instance. | |
getMaxAge ( ) : integer | null | Returns the number of seconds after the time specified in the response's Date header when the response should no longer be considered fresh. | |
getProtocolVersion ( ) : string | Gets the HTTP protocol version. | |
getStatusCode ( ) : integer | Retrieves the status code for the current web response. | |
getTtl ( ) : integer | null | Returns the response's time-to-live in seconds. | |
getVary ( ) : array | Returns an array of header names given in the Vary header. | |
hasVary ( ) : boolean | Returns true if the response includes a Vary header. | |
isCacheable ( ) : boolean | Returns true if the response is worth caching under any circumstance. | |
isClientError ( ) : boolean | Is there a client error? | |
isEmpty ( ) : boolean | Is the response empty? | |
isForbidden ( ) : boolean | Is the response forbidden? | |
isFresh ( ) : boolean | Returns true if the response is "fresh". | |
isInformational ( ) : boolean | Is response informative? | |
isInvalid ( ) : boolean | Is response invalid? | |
isNotFound ( ) : boolean | Is the response a not found error? | |
isNotModified ( |
Determines if the Response validators (ETag, Last-Modified) match a conditional value specified in the Request. | |
isOk ( ) : boolean | Is the response OK? | |
isRedirect ( string $location = null ) : boolean | Is the response a redirect of some form? | |
isRedirection ( ) : boolean | Is the response a redirect? | |
isServerError ( ) : boolean | Was there a server side error? | |
isSuccessful ( ) : boolean | Is response successful? | |
isValidateable ( ) : boolean | Returns true if the response includes headers that can be used to validate the response with the origin server using a conditional GET request. | |
mustRevalidate ( ) : boolean | Returns true if the response must be revalidated by caches. | |
prepare ( |
Prepares the Response before it is sent to the client. | |
send ( ) : |
Sends HTTP headers and content. | |
sendContent ( ) : |
Sends content for the current web response. | |
sendHeaders ( ) : |
Sends HTTP headers. | |
setCache ( array $options ) : |
Sets the response's cache headers (validation and/or expiration). | |
setCharset ( string $charset ) : |
Sets the response charset. | |
setClientTtl ( integer $seconds ) : |
Sets the response's time-to-live for private/client caches. | |
setContent ( mixed $content ) : |
Sets the response content. | |
setDate ( DateTime $date ) : |
Sets the Date header. | |
setEtag ( string | null $etag = null, boolean $weak = false ) : |
Sets the ETag value. | |
setExpires ( DateTime $date = null ) : |
Sets the Expires HTTP header with a DateTime instance. | |
setLastModified ( DateTime $date = null ) : |
Sets the Last-Modified HTTP header with a DateTime instance. | |
setMaxAge ( integer $value ) : |
Sets the number of seconds after which the response should no longer be considered fresh. | |
setNotModified ( ) : |
Modifies the response so that it conforms to the rules defined for a 304 status code. | |
setPrivate ( ) : |
Marks the response as "private". | |
setProtocolVersion ( string $version ) : |
Sets the HTTP protocol version (1.0 or 1.1). | |
setPublic ( ) : |
Marks the response as "public". | |
setSharedMaxAge ( integer $value ) : |
Sets the number of seconds after which the response should no longer be considered fresh by shared caches. | |
setStatusCode ( integer $code, mixed $text = null ) : |
Sets the response status code. | |
setTtl ( integer $seconds ) : |
Sets the response's time-to-live for shared caches. | |
setVary ( string | array $headers, boolean $replace = true ) : |
Sets the Vary header. |
Method | Description | |
---|---|---|
ensureIEOverSSLCompatibility ( |
Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. |
public __toString ( ) : string | ||
return | string | The Response as an HTTP string |
public static closeOutputBuffers ( integer $targetLevel, boolean $flush ) | ||
$targetLevel | integer | The target output buffering level |
$flush | boolean | Whether to flush or clean the buffers |
protected ensureIEOverSSLCompatibility ( |
||
$request |
public expire ( ) : |
||
return |
public getCharset ( ) : string | ||
return | string | Character set |
public getContent ( ) : string | ||
return | string | Content |
public getDate ( ) : DateTime | ||
return | DateTime | A \DateTime instance |
public getExpires ( ) : DateTime | null | ||
return | DateTime | null | A DateTime instance or null if the header does not exist |
public getLastModified ( ) : DateTime | null | ||
return | DateTime | null | A DateTime instance or null if the header does not exist |
public getProtocolVersion ( ) : string | ||
return | string | The HTTP protocol version |
public getStatusCode ( ) : integer | ||
return | integer | Status code |
public isCacheable ( ) : boolean | ||
return | boolean | true if the response is worth caching, false otherwise |
public isClientError ( ) : boolean | ||
return | boolean |
public isForbidden ( ) : boolean | ||
return | boolean |
public isInformational ( ) : boolean | ||
return | boolean |
public isNotFound ( ) : boolean | ||
return | boolean |
public isNotModified ( |
||
$request | A Request instance | |
return | boolean | true if the Response validators match the Request, false otherwise |
public isRedirect ( string $location = null ) : boolean | ||
$location | string | |
return | boolean |
public isRedirection ( ) : boolean | ||
return | boolean |
public isServerError ( ) : boolean | ||
return | boolean |
public isSuccessful ( ) : boolean | ||
return | boolean |
public isValidateable ( ) : boolean | ||
return | boolean | true if the response is validateable, false otherwise |
public mustRevalidate ( ) : boolean | ||
return | boolean | true if the response must be revalidated by a cache, false otherwise |
public prepare ( |
||
$request | A Request instance | |
return | The current response |
public sendContent ( ) : |
||
return |
public setCharset ( string $charset ) : |
||
$charset | string | Character set |
return |
public setClientTtl ( integer $seconds ) : |
||
$seconds | integer | Number of seconds |
return |
public setContent ( mixed $content ) : |
||
$content | mixed | Content that can be cast to string |
return |
public setDate ( DateTime $date ) : |
||
$date | DateTime | A \DateTime instance |
return |
public setExpires ( DateTime $date = null ) : |
||
$date | DateTime | A \DateTime instance or null to remove the header |
return |
public setLastModified ( DateTime $date = null ) : |
||
$date | DateTime | A \DateTime instance or null to remove the header |
return |
public setNotModified ( ) : |
||
return |
public setPrivate ( ) : |
||
return |
public setProtocolVersion ( string $version ) : |
||
$version | string | The HTTP protocol version |
return |
public setPublic ( ) : |
||
return |
public setStatusCode ( integer $code, mixed $text = null ) : |
||
$code | integer | HTTP status code |
$text | mixed | HTTP status text If the status text is null it will be automatically populated for the known status codes and left empty otherwise. |
return |
public ResponseHeaderBag,Symfony\Component\HttpFoundation $headers | ||
return |
public static array $statusTexts | ||
return | array |