Свойство | 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. |
Свойство | Type | Description | |
---|---|---|---|
$charset | string | ||
$content | string | ||
$statusCode | integer | ||
$statusText | string | ||
$version | string |
Méthode | 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. |
Méthode | Description | |
---|---|---|
ensureIEOverSSLCompatibility ( |
Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. |
public __toString ( ) : string | ||
Résultat | 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 ( ) : |
||
Résultat |
public getCharset ( ) : string | ||
Résultat | string | Character set |
public getContent ( ) : string | ||
Résultat | string | Content |
public getDate ( ) : DateTime | ||
Résultat | DateTime | A \DateTime instance |
public getExpires ( ) : DateTime | null | ||
Résultat | DateTime | null | A DateTime instance or null if the header does not exist |
public getLastModified ( ) : DateTime | null | ||
Résultat | DateTime | null | A DateTime instance or null if the header does not exist |
public getProtocolVersion ( ) : string | ||
Résultat | string | The HTTP protocol version |
public getStatusCode ( ) : integer | ||
Résultat | integer | Status code |
public isCacheable ( ) : boolean | ||
Résultat | boolean | true if the response is worth caching, false otherwise |
public isClientError ( ) : boolean | ||
Résultat | boolean |
public isForbidden ( ) : boolean | ||
Résultat | boolean |
public isInformational ( ) : boolean | ||
Résultat | boolean |
public isNotFound ( ) : boolean | ||
Résultat | boolean |
public isNotModified ( |
||
$request | A Request instance | |
Résultat | boolean | true if the Response validators match the Request, false otherwise |
public isRedirect ( string $location = null ) : boolean | ||
$location | string | |
Résultat | boolean |
public isRedirection ( ) : boolean | ||
Résultat | boolean |
public isServerError ( ) : boolean | ||
Résultat | boolean |
public isSuccessful ( ) : boolean | ||
Résultat | boolean |
public isValidateable ( ) : boolean | ||
Résultat | boolean | true if the response is validateable, false otherwise |
public mustRevalidate ( ) : boolean | ||
Résultat | boolean | true if the response must be revalidated by a cache, false otherwise |
public prepare ( |
||
$request | A Request instance | |
Résultat | The current response |
public sendContent ( ) : |
||
Résultat |
public sendHeaders ( ) : |
||
Résultat |
public setCharset ( string $charset ) : |
||
$charset | string | Character set |
Résultat |
public setClientTtl ( integer $seconds ) : |
||
$seconds | integer | Number of seconds |
Résultat |
public setContent ( mixed $content ) : |
||
$content | mixed | Content that can be cast to string |
Résultat |
public setDate ( DateTime $date ) : |
||
$date | DateTime | A \DateTime instance |
Résultat |
public setExpires ( DateTime $date = null ) : |
||
$date | DateTime | A \DateTime instance or null to remove the header |
Résultat |
public setLastModified ( DateTime $date = null ) : |
||
$date | DateTime | A \DateTime instance or null to remove the header |
Résultat |
public setNotModified ( ) : |
||
Résultat |
public setPrivate ( ) : |
||
Résultat |
public setProtocolVersion ( string $version ) : |
||
$version | string | The HTTP protocol version |
Résultat |
public setPublic ( ) : |
||
Résultat |
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. |
Résultat |
public ResponseHeaderBag,Symfony\Component\HttpFoundation $headers | ||
Résultat |
public static array $statusTexts | ||
Résultat | array |