Class CacheControl

Summary

Fully Qualified Name: Zend\Http\Header\CacheControl
Implements: HeaderInterface

Description

Methods

Name Description Defined By
addDirective() Add a directive For directives like 'max-age=60', $value = '60' For directives like 'private', use the default $value = true CacheControl
fromString() Creates a CacheControl object from a headerLine CacheControl
getDirective() Fetch the value of a directive from the internal directive array CacheControl
getFieldName() Required from HeaderDescription interface CacheControl
getFieldValue() Assembles the directives into a comma-delimited string CacheControl
hasDirective() Check the internal directives array for a directive CacheControl
isEmpty() Checks if the internal directives array is empty CacheControl
removeDirective() Remove a directive CacheControl
toString() Returns a string representation of the HTTP Cache-Control header CacheControl

Method Details

addDirective()

Add a directive For directives like 'max-age=60', $value = '60' For directives like 'private', use the default $value = true

Parameter Name Type Description
$key string
$value string|bool

Returns: \CacheControl - provides the fluent interface

fromString()

Creates a CacheControl object from a headerLine

Parameter Name Type Description
$headerLine string

Returns: \CacheControl

getDirective()

Fetch the value of a directive from the internal directive array

Parameter Name Type Description
$key string

Returns: string|null

getFieldName()

Required from HeaderDescription interface

Returns: string

getFieldValue()

Assembles the directives into a comma-delimited string

Returns: string

hasDirective()

Check the internal directives array for a directive

Parameter Name Type Description
$key string

Returns: bool

isEmpty()

Checks if the internal directives array is empty

Returns: bool

removeDirective()

Remove a directive

Parameter Name Type Description
$key string

Returns: \CacheControl - provides the fluent interface

toString()

Returns a string representation of the HTTP Cache-Control header

Returns: string

Top