PHP Class Symfony\Component\HttpFoundation\ResponseHeaderBag

Author: Fabien Potencier ([email protected])
Inheritance: extends HeaderBag
Afficher le fichier Open project: symfony/symfony Class Usage Examples

Protected Properties

Свойство Type Description
$computedCacheControl array
$cookies array
$headerNames array

Méthodes publiques

Méthode Description
__construct ( array $headers = [] ) Constructor.
all ( )
allPreserveCase ( ) : array Returns the headers, with original capitalizations.
allPreserveCaseWithoutCookies ( )
clearCookie ( string $name, string $path = '/', string $domain = null, boolean $secure = false, boolean $httpOnly = true ) Clears a cookie in the browser.
getCacheControlDirective ( $key )
getCookies ( string $format = self::COOKIES_FLAT ) : array Returns an array with all cookies.
hasCacheControlDirective ( $key )
makeDisposition ( string $disposition, string $filename, string $filenameFallback = '' ) : string Generates a HTTP Content-Disposition field-value.
remove ( $key )
removeCookie ( string $name, string $path = '/', string $domain = null ) Removes a cookie from the array, but does not unset it in the browser.
replace ( array $headers = [] )
set ( $key, $values, $replace = true )
setCookie ( Cookie $cookie ) Sets a cookie.

Méthodes protégées

Méthode Description
computeCacheControlValue ( ) : string Returns the calculated value of the cache-control header.

Method Details

__construct() public méthode

Constructor.
public __construct ( array $headers = [] )
$headers array An array of HTTP headers

all() public méthode

public all ( )

allPreserveCase() public méthode

Returns the headers, with original capitalizations.
public allPreserveCase ( ) : array
Résultat array An array of headers

allPreserveCaseWithoutCookies() public méthode

clearCookie() public méthode

Clears a cookie in the browser.
public clearCookie ( string $name, string $path = '/', string $domain = null, boolean $secure = false, boolean $httpOnly = true )
$name string
$path string
$domain string
$secure boolean
$httpOnly boolean

computeCacheControlValue() protected méthode

This considers several other headers and calculates or modifies the cache-control header to a sensible, conservative value.
protected computeCacheControlValue ( ) : string
Résultat string

getCacheControlDirective() public méthode

public getCacheControlDirective ( $key )

getCookies() public méthode

Returns an array with all cookies.
public getCookies ( string $format = self::COOKIES_FLAT ) : array
$format string
Résultat array

hasCacheControlDirective() public méthode

public hasCacheControlDirective ( $key )

makeDisposition() public méthode

Generates a HTTP Content-Disposition field-value.
See also: RFC 6266
public makeDisposition ( string $disposition, string $filename, string $filenameFallback = '' ) : string
$disposition string One of "inline" or "attachment"
$filename string A unicode string
$filenameFallback string A string containing only ASCII characters that is semantically equivalent to $filename. If the filename is already ASCII, it can be omitted, or just copied from $filename
Résultat string A string suitable for use as a Content-Disposition field-value

remove() public méthode

public remove ( $key )

removeCookie() public méthode

Removes a cookie from the array, but does not unset it in the browser.
public removeCookie ( string $name, string $path = '/', string $domain = null )
$name string
$path string
$domain string

replace() public méthode

public replace ( array $headers = [] )
$headers array

set() public méthode

public set ( $key, $values, $replace = true )

setCookie() public méthode

Sets a cookie.
public setCookie ( Cookie $cookie )
$cookie Cookie

Property Details

$computedCacheControl protected_oe property

protected array $computedCacheControl
Résultat array

$cookies protected_oe property

protected array $cookies
Résultat array

$headerNames protected_oe property

protected array $headerNames
Résultat array