class FormRequest extends Request implements RequestInterface

Class FormRequest

Methods

string|array|null
getHeader(string $name, string|boolean $glue = "\r\n")

Returns the value of a header.

array
getHeaderAttributes(string $name)

Returns a header's attributes.

string|null
getHeaderAttribute(string $header, string $attribute)

Returns the value of a particular header attribute.

toDomDocument()

Returns the current message as a DOMDocument.

setHeaders(array $headers)

Sets all headers on the current message.

from Request
addHeader(string $header)

Adds a header to this message.

from Request
addHeaders(array $headers)

Adds a set of headers to this message.

array
getHeaders()

Merges cookie headers on the way out.

setContent(string $content)

Sets the content of the message.

string
getContent()

No description

string
__toString()

Returns a string representation of the current request.

from Request
flattenHeaders(array $headers)

No description

__construct(string $method = self::METHOD_POST, string $resource = '/', string $host = null)

FormRequest constructor.

setMethod(string $method)

Sets the HTTP method of the current request.

from Request
string
getMethod()

Returns the HTTP method of the current request.

from Request
setResource(string $resource)

Sets the resource for the current request.

from Request
string
getResource()

Returns the resource portion of the request line.

setHost(string $host)

Sets the host for the current request.

from Request
string|null
getHost()

Returns the value of the host header.

from Request
setProtocolVersion($protocolVersion)

No description

from Request
float
getProtocolVersion()

Returns the protocol version of the current request.

from Request
string
getUrl()

A convenience method for getting the full URL of the current request.

from Request
fromUrl(Url|string $url)

A convenience method for populating the current request from a URL.

from Request
Boolean
isSecure()

Returns true if the current request is secure.

from Request
setField($name, $value)

Sets the value of a form field.

addFields(array $fields)

No description

setFields(array $fields)

No description

getFields()

No description

Details

in AbstractMessage at line 22
string|array|null getHeader(string $name, string|boolean $glue = "\r\n")

Returns the value of a header.

Parameters

string $name A header name
string|boolean $glue Glue for implode, or false to return an array

Return Value

string|array|null The header value(s)

in AbstractMessage at line 47
array getHeaderAttributes(string $name)

Returns a header's attributes.

Parameters

string $name A header name

Return Value

array An associative array of attributes

in AbstractMessage at line 74
string|null getHeaderAttribute(string $header, string $attribute)

Returns the value of a particular header attribute.

Parameters

string $header A header name
string $attribute An attribute name

Return Value

string|null The value of the attribute or null if it isn't set

in AbstractMessage at line 88
DOMDocument toDomDocument()

Returns the current message as a DOMDocument.

Return Value

DOMDocument

in Request at line 33
setHeaders(array $headers)

Sets all headers on the current message.

Headers can be complete ["Header: value"] pairs or an associative array ["Header" => "value"]

Parameters

array $headers An array of header lines

in Request at line 42
addHeader(string $header)

Adds a header to this message.

Parameters

string $header A header line

in AbstractMessage at line 114
addHeaders(array $headers)

Adds a set of headers to this message.

Headers can be complete ["Header: value"] pairs or an associative array ["Header" => "value"]

Parameters

array $headers Headers

at line 87
array getHeaders()

Merges cookie headers on the way out.

Return Value

array An array of header lines (integer indexes, e.g. ["Header: value"])

at line 82
setContent(string $content)

Sets the content of the message.

Parameters

string $content The message content

at line 107
string getContent()

Return Value

string The message content

in Request at line 142
string __toString()

Returns a string representation of the current request.

Return Value

string The message

in AbstractMessage at line 145
protected flattenHeaders(array $headers)

Parameters

array $headers

at line 21
__construct(string $method = self::METHOD_POST, string $resource = '/', string $host = null)

FormRequest constructor.

Parameters

string $method
string $resource
string $host

in Request at line 55
setMethod(string $method)

Sets the HTTP method of the current request.

Parameters

string $method The request method

in Request at line 60
string getMethod()

Returns the HTTP method of the current request.

Return Value

string An HTTP method

in Request at line 65
setResource(string $resource)

Sets the resource for the current request.

Parameters

string $resource The resource being requested

at line 67
string getResource()

Returns the resource portion of the request line.

Return Value

string The resource requested

in Request at line 75
setHost(string $host)

Sets the host for the current request.

Parameters

string $host The host

in Request at line 80
string|null getHost()

Returns the value of the host header.

Return Value

string|null The host

in Request at line 85
setProtocolVersion($protocolVersion)

Parameters

$protocolVersion

in Request at line 90
float getProtocolVersion()

Returns the protocol version of the current request.

Return Value

float The protocol version

in Request at line 100
string getUrl()

A convenience method for getting the full URL of the current request.

Return Value

string

in Request at line 110
fromUrl(Url|string $url)

A convenience method for populating the current request from a URL.

Parameters

Url|string $url An URL

in Request at line 124
Boolean isSecure()

Returns true if the current request is secure.

Return Value

Boolean True if the request is secure

at line 34
setField($name, $value)

Sets the value of a form field.

If the value is an array it will be flattened and one field value will be added for each leaf.

Parameters

$name
$value

at line 49
addFields(array $fields)

Parameters

array $fields

at line 56
setFields(array $fields)

Parameters

array $fields

at line 62
getFields()