Class HeaderBag

HeaderBag is a container for HTTP headers.

Methods summary
public
# __construct( array $headers = array() )

Constructor.

public string
# __toString( )

Returns the headers as a string.

public array
# all( )

Returns the headers.

public array
# keys( )

Returns the parameter keys.

public
# replace( array $headers = array() )

Replaces the current HTTP headers by a new set.

public
# add( array $headers )

Adds new headers the current HTTP headers set.

public string|array
# get( string $key, mixed $default = null, Boolean $first = true )

Returns a header value by name.

public
# set( string $key, string|array $values, Boolean $replace = true )

Sets a header by name.

public Boolean
# has( string $key )

Returns true if the HTTP header is defined.

public Boolean
# contains( string $key, string $value )

Returns true if the given HTTP header contains the given value.

public
# remove( string $key )

Removes a header.

public DateTime
# getDate( string $key, DateTime $default = null )

Returns the HTTP header value converted to a date.

public
# addCacheControlDirective( $key, $value = true )
public
public
public
protected
protected array
# parseCacheControl( string $header )

Parses a Cache-Control HTTP header.

Properties summary
protected $headers
#
protected $cacheControl
#