class Request (View source)

Methods

static string
path(bool $info = false)

Get current HTTP path or route path

static bool
is(string $check)

Check if is a specific HTTP method, HTTPS, and xmlhttprequest (Depends on how an ajax call was made)

static string|null
header($name, $alternative = null)

Get HTTP headers from current request

static string|null
query()

Get querystring, this method is useful for anyone who uses IIS.

static mixed
get(string $key, mixed $alternative = null)

Get a value from $_GET, if $_GET is a array multidimensional, you can use dot like path: If $_GET['foo'] returns this array( 'baz' => 'bar' => 1); use Request::get('foo.bar.baz'); for return 1

static mixed
post(string $key, mixed $alternative = null)

Get a value from $_POST, if $_POST is a array multidimensional, you can use dot like path: If $_POST['foo'] returns this array( 'baz' => 'bar' => 1); use Request::post('foo.bar.baz');

static mixed
cookie(string $key, mixed $alternative = null)

Get a value from $_COOKIE (support path using dots)

static mixed
file(string $key)

Get a value from $_FILES (support path using dots)

static resource|bool
raw(bool $binary = true)

Get a value input handler

static 
json(bool $array = false)

Get a value input handler

static Document
xml()

Create a Document instance from HTTP request

Details

static string path(bool $info = false)

Get current HTTP path or route path

Parameters

bool $info

Return Value

string

static bool is(string $check)

Check if is a specific HTTP method, HTTPS, and xmlhttprequest (Depends on how an ajax call was made)

Parameters

string $check

Return Value

bool

static string|null header($name, $alternative = null)

Get HTTP headers from current request

Parameters

$name
$alternative

Return Value

string|null

static string|null query()

Get querystring, this method is useful for anyone who uses IIS.

Return Value

string|null

static mixed get(string $key, mixed $alternative = null)

Get a value from $_GET, if $_GET is a array multidimensional, you can use dot like path: If $_GET['foo'] returns this array( 'baz' => 'bar' => 1); use Request::get('foo.bar.baz'); for return 1

Parameters

string $key
mixed $alternative

Return Value

mixed

static mixed post(string $key, mixed $alternative = null)

Get a value from $_POST, if $_POST is a array multidimensional, you can use dot like path: If $_POST['foo'] returns this array( 'baz' => 'bar' => 1); use Request::post('foo.bar.baz');

Parameters

string $key
mixed $alternative

Return Value

mixed

Get a value from $_COOKIE (support path using dots)

Parameters

string $key
mixed $alternative

Return Value

mixed

static mixed file(string $key)

Get a value from $_FILES (support path using dots)

Parameters

string $key

Return Value

mixed

static resource|bool raw(bool $binary = true)

Get a value input handler

Parameters

bool $binary

Return Value

resource|bool

static json(bool $array = false)

Get a value input handler

Parameters

bool $array

Exceptions

Exception

static Document xml()

Create a Document instance from HTTP request

Return Value

Document