Свойство | Type | Description | |
---|---|---|---|
$cacheDirectives | array | ||
$cookies | array | ||
$fields | array |
Méthode | Description | |
---|---|---|
__construct ( array $fields = [] ) | Constructs a new Headers object. | |
createFromServer ( array $server ) : |
Creates a new Headers instance from the given $_SERVER-superglobal-like array. | |
eatCookie ( string $name ) : void | Although not 100% semantically correct, an alias for removeCookie() | |
get ( string $name ) : array | string | Returns the specified HTTP header | |
getAll ( ) : array | Returns all header fields | |
getCacheControlDirective ( string $name ) : mixed | Returns the value of the specified Cache-Control directive. | |
getCookie ( string $name ) : |
Returns a cookie specified by the given name | |
getCookies ( ) : array | Returns all cookies | |
has ( string $name ) : boolean | Checks if the specified HTTP header exists | |
hasCookie ( string $name ) : boolean | Checks if the specified cookie exists | |
remove ( string $name ) : void | Removes the specified header field | |
removeCacheControlDirective ( string $name ) : void | Removes a special directive previously set for the Cache-Control header. | |
removeCookie ( string $name ) : void | Removes the specified cookie if it exists | |
set ( string $name, array | string | DateTime $values, boolean $replaceExistingHeader = true ) : void | Sets the specified HTTP header | |
setCacheControlDirective ( string $name, string $value = null ) : void | Sets a special directive for use in the Cache-Control header, according to RFC 2616 / 14.9 | |
setCookie ( |
Sets a cookie |
Méthode | Description | |
---|---|---|
getCacheControlHeader ( ) : string | Renders and returns a Cache-Control header, based on the previously set cache control directives. | |
setCacheControlDirectivesFromRawHeader ( string $rawFieldValue ) : void | Internally sets the cache directives correctly by parsing the given Cache-Control field value. | |
setCookiesFromRawHeader ( string $rawFieldValue ) : void | Internally sets cookie objects based on the Cookie header field value. |
public __construct ( array $fields = [] ) | ||
$fields | array | Field names and their values (either as single value or array of values) |
public static createFromServer ( array $server ) : |
||
$server | array | An array similar or equal to $_SERVER, containing headers in the form of "HTTP_FOO_BAR" |
Résultat |
public getCacheControlDirective ( string $name ) : mixed | ||
$name | string | Name of the cache directive, for example "max-age" |
Résultat | mixed |
protected getCacheControlHeader ( ) : string | ||
Résultat | string | Either the value of the header or NULL if it shall be omitted |
public removeCacheControlDirective ( string $name ) : void | ||
$name | string | Name of the directive, for example "public" |
Résultat | void |
public removeCookie ( string $name ) : void | ||
$name | string | Name of the cookie to remove |
Résultat | void |
public set ( string $name, array | string | DateTime $values, boolean $replaceExistingHeader = true ) : void | ||
$name | string | Name of the header, for example "Location", "Content-Description" etc. |
$values | array | string | DateTime | An array of values or a single value for the specified header field |
$replaceExistingHeader | boolean | If a header with the same name should be replaced. Default is TRUE. |
Résultat | void |
protected setCacheControlDirectivesFromRawHeader ( string $rawFieldValue ) : void | ||
$rawFieldValue | string | The value of a specification compliant Cache-Control header |
Résultat | void |
protected setCookiesFromRawHeader ( string $rawFieldValue ) : void | ||
$rawFieldValue | string | The value of a specification compliant Cookie header |
Résultat | void |