PHP Class Ergo\Http\HeaderCollection

Inheritance: implements IteratorAggregate
Afficher le fichier Open project: 99designs/ergo Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( $headers = [] ) Constructor
add ( $header ) Adds a header to the collection, either in "Header: Value" format or an {@link HeaderField} object.
getIterator ( ) * (non-phpdoc)
remove ( $header ) Remove a header by name
replace ( $header ) Replaces a header in the collection, either in "Header: Value" format or an {@link HeaderField} object.
toArray ( $crlf = true ) : array Returns an array of the string versions of headers
value ( $name, $default = false ) : string Gets a single header value
values ( $name ) : array Gets an array of the values for a header

Method Details

__construct() public méthode

Constructor
public __construct ( $headers = [] )
$headers HeaderField[]

add() public méthode

Adds a header to the collection, either in "Header: Value" format or an {@link HeaderField} object.
public add ( $header )

getIterator() public méthode

* (non-phpdoc)
See also: IteratorAggregate::getIterator
public getIterator ( )

remove() public méthode

Remove a header by name
public remove ( $header )

replace() public méthode

Replaces a header in the collection, either in "Header: Value" format or an {@link HeaderField} object.
public replace ( $header )

toArray() public méthode

Returns an array of the string versions of headers
public toArray ( $crlf = true ) : array
Résultat array

value() public méthode

Gets a single header value
public value ( $name, $default = false ) : string
Résultat string

values() public méthode

Gets an array of the values for a header
public values ( $name ) : array
Résultat array