class Request (View source)

Methods

static string
path()

Get current HTTP path

static bool
is(string $type)

Checks if the request matches a specific type: HTTPS, XHR, Pjax, prefetch, save-data, GPC, or a standard HTTP method (e.g., GET, POST).

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

Get HTTP header from current request

static string|null
query()

Get querystring - Note: same as $_SERVER['QUERY_STRING'], but with framework adjustments on IIS web server

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 ['baz' => ['baz' => 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 ['baz' => ['baz' => 1]] use Request::post('foo.bar.baz')

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

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

Details

static string path()

Get current HTTP path

Return Value

string

static bool is(string $type)

Checks if the request matches a specific type: HTTPS, XHR, Pjax, prefetch, save-data, GPC, or a standard HTTP method (e.g., GET, POST).

Parameters

string $type

The type to check (e.g., gpc, pjax, prefetch, save, secure, xhr, post, head)

Return Value

bool

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

Get HTTP header from current request

Parameters

string $name
mixed $alternative

Return Value

mixed

static string|null query()

Get querystring - Note: same as $_SERVER['QUERY_STRING'], but with framework adjustments on IIS web server

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 ['baz' => ['baz' => 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 ['baz' => ['baz' => 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