class Request (View source)

A server request representation

Methods

static Request
fromGlobals()

Create a new instance from php super globals.

__construct(array $get, array $post, array $cookie, array $files, array $server, array $headers)

Constructor.

string
getMethod()

Get the request method.

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.

string
getUrl()

Get the request url.

mixed
get()

Get a value from the GET parameters.

mixed
post()

Get a value from the POST parameters.

mixed
cookie()

Get a value from the COOKIE parameters.

mixed
files()

Get a value from the FILES parameters.

mixed
server()

Get a value from the SERVER parameters.

mixed
headers()

Get a value from the headers.

Details

static Request fromGlobals()

Create a new instance from php super globals.

Return Value

Request

__construct(array $get, array $post, array $cookie, array $files, array $server, array $headers)

Constructor.

Parameters

array $get
array $post
array $cookie
array $files
array $server
array $headers

string getMethod()

Get the request method.

Return Value

string

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

string getUrl()

Get the request url.

Return Value

string

mixed get()

Get a value from the GET parameters.

Return Value

mixed

See also

\WPEmerge\Support\Arr

mixed post()

Get a value from the POST parameters.

Return Value

mixed

See also

\WPEmerge\Support\Arr

Get a value from the COOKIE parameters.

Return Value

mixed

See also

\WPEmerge\Support\Arr

mixed files()

Get a value from the FILES parameters.

Return Value

mixed

See also

\WPEmerge\Support\Arr

mixed server()

Get a value from the SERVER parameters.

Return Value

mixed

See also

\WPEmerge\Support\Arr

mixed headers()

Get a value from the headers.

Return Value

mixed

See also

\WPEmerge\Support\Arr