Methods
Add a directive
For directives like 'max-age=60', $value = '60'
For directives like 'private', use the default $value = true
addDirective(string $key, string | bool $value) : \Zend\Http\Header\CacheControl
Parameters
$key
string
$value
stringbool
Returns
Creates a CacheControl object from a headerLine
fromString(string $headerLine) : \Zend\Http\Header\CacheControl
Parameters
$headerLine
string
Exceptions
Returns
Fetch the value of a directive from the internal directive array
getDirective(string $key) : string | null
Parameters
$key
string
Returns
string
null
Required from HeaderDescription interface
getFieldName() : string
Assembles the directives into a comma-delimited string
getFieldValue() : string
Check the internal directives array for a directive
hasDirective(string $key) : bool
Parameters
$key
string
Returns
bool
Checks if the internal directives array is empty
isEmpty() : bool
Returns a string representation of the HTTP Cache-Control header
toString() : string
Returns in form of "NAME: VALUE"
Returns
string
Internal function used by parseValue to match tokens
match(array $tokens, string $string, string $lastMatch) : int
Parameters
$tokens
array
$string
string
$lastMatch
string
Returns
int
Internal function for parsing the value part of a
HTTP Cache-Control header
parseValue(string $value) : array
Parameters
$value
string
Exceptions
Returns
array
Properties
Array of Cache-Control directives
$directives : array