class Request extends ServerRequest implements RequestInterface (View source)

A representation of a request to the server.

Methods

static Request
fromGlobals()

No description

string
getUrl()

No description

getMethod()

{@inheritDoc}

boolean
isGet()

Check if the request method is GET.

boolean
isHead()

Check if the request method is HEAD.

boolean
isPost()

Check if the request method is POST.

boolean
isPut()

Check if the request method is PUT.

boolean
isPatch()

Check if the request method is PATCH.

boolean
isDelete()

Check if the request method is DELETE.

boolean
isOptions()

Check if the request method is OPTIONS.

boolean
isReadVerb()

Check if the request method is a "read" verb.

boolean
isAjax()

Check if the request is an ajax request.

mixed
attributes(string $key = '', mixed $default = null)

Get a value from the request attributes.

mixed
query(string $key = '', mixed $default = null)

Get a value from the request query (i.e. $_GET).

mixed
body(string $key = '', mixed $default = null)

Get a value from the request body (i.e. $_POST).

mixed
cookies(string $key = '', mixed $default = null)

Get a value from the COOKIE parameters.

mixed
files(string $key = '', mixed $default = null)

Get a value from the FILES parameters.

mixed
server(string $key = '', mixed $default = null)

Get a value from the SERVER parameters.

mixed
headers(string $key = '', mixed $default = null)

Get a value from the headers.

Details

static Request fromGlobals()

Return Value

Request

string getUrl()

Return Value

string

getMethod()

{@inheritDoc}

boolean isGet()

Check if the request method is GET.

Return Value

boolean

boolean isHead()

Check if the request method is HEAD.

Return Value

boolean

boolean isPost()

Check if the request method is POST.

Return Value

boolean

boolean isPut()

Check if the request method is PUT.

Return Value

boolean

boolean isPatch()

Check if the request method is PATCH.

Return Value

boolean

boolean isDelete()

Check if the request method is DELETE.

Return Value

boolean

boolean isOptions()

Check if the request method is OPTIONS.

Return Value

boolean

boolean isReadVerb()

Check if the request method is a "read" verb.

Return Value

boolean

boolean isAjax()

Check if the request is an ajax request.

Return Value

boolean

mixed attributes(string $key = '', mixed $default = null)

Get a value from the request attributes.

Parameters

string $key
mixed $default

Return Value

mixed

See also

::get()

mixed query(string $key = '', mixed $default = null)

Get a value from the request query (i.e. $_GET).

Parameters

string $key
mixed $default

Return Value

mixed

See also

::get()

mixed body(string $key = '', mixed $default = null)

Get a value from the request body (i.e. $_POST).

Parameters

string $key
mixed $default

Return Value

mixed

See also

::get()

mixed cookies(string $key = '', mixed $default = null)

Get a value from the COOKIE parameters.

Parameters

string $key
mixed $default

Return Value

mixed

See also

::get()

mixed files(string $key = '', mixed $default = null)

Get a value from the FILES parameters.

Parameters

string $key
mixed $default

Return Value

mixed

See also

::get()

mixed server(string $key = '', mixed $default = null)

Get a value from the SERVER parameters.

Parameters

string $key
mixed $default

Return Value

mixed

See also

::get()

mixed headers(string $key = '', mixed $default = null)

Get a value from the headers.

Parameters

string $key
mixed $default

Return Value

mixed

See also

::get()