HumHub Documentation (unofficial)

GenericMultiHeader extends GenericHeader
in package
implements MultipleHeaderInterface

Content-Location Header

Table of Contents

Interfaces

MultipleHeaderInterface
Interface for HTTP Header classes.

Properties

$fieldName  : string
$fieldValue  : string

Methods

__construct()  : mixed
Constructor
fromString()  : static|array<string|int, static>
Factory to generate a header object from a string
getFieldName()  : string
Retrieve header field name
getFieldValue()  : string
Retrieve header field value
setFieldName()  : $this
Set header field name
setFieldValue()  : $this
Set header field value
splitHeaderLine()  : array<string|int, string>
Splits the header line in `name` and `value` parts.
toString()  : string
Cast to string as a well formed HTTP header line
toStringMultipleHeaders()  : string

Properties

Methods

__construct()

Constructor

public __construct([null|string $fieldName = null ][, null|string $fieldValue = null ]) : mixed
Parameters
$fieldName : null|string = null
$fieldValue : null|string = null

fromString()

Factory to generate a header object from a string

public static fromString(string $headerLine) : static|array<string|int, static>
Parameters
$headerLine : string
Return values
static|array<string|int, static>

getFieldName()

Retrieve header field name

public getFieldName() : string
Return values
string

getFieldValue()

Retrieve header field value

public getFieldValue() : string
Return values
string

setFieldName()

Set header field name

public setFieldName(string $fieldName) : $this
Parameters
$fieldName : string
Tags
throws
InvalidArgumentException

If the name does not match with RFC 2616 format.

Return values
$this

setFieldValue()

Set header field value

public setFieldValue(string $fieldValue) : $this
Parameters
$fieldValue : string
Return values
$this

splitHeaderLine()

Splits the header line in `name` and `value` parts.

public static splitHeaderLine(string $headerLine) : array<string|int, string>
Parameters
$headerLine : string
Tags
throws
InvalidArgumentException

If header does not match with the format name:value.

Return values
array<string|int, string>

name in the first index and value in the second.

toString()

Cast to string as a well formed HTTP header line

public toString() : string

Returns in form of "NAME: VALUE\r\n"

Return values
string

toStringMultipleHeaders()

public toStringMultipleHeaders(array<string|int, mixed> $headers) : string
Parameters
$headers : array<string|int, mixed>
Return values
string

        
On this page

Search results