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