Request
class Request (View source)
Methods
Get current HTTP path
Checks if the request matches a specific type: HTTPS, XHR, Pjax, prefetch, save-data, GPC, or a standard HTTP method (e.g., GET, POST).
Get HTTP header from current request
Get querystring - Note: same as $_SERVER['QUERY_STRING'], but with framework adjustments on IIS web server
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
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')
Get a value from $_COOKIE (support path using dots)
Details
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)