Request
class Request (View source)
Methods
Get current HTTP path or route path
Check if is a specific HTTP method, HTTPS, and xmlhttprequest (Depends on how an ajax call was made)
Get HTTP headers from current request
Get querystring, this method is useful for anyone who uses IIS.
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
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');
Get a value from $_COOKIE
(support path using dots)
Get a value from $_FILES
(support path using dots)
Get a value input handler
Get a value input handler
Details
at line 31
static string
path(bool $info = false)
Get current HTTP path or route path
at line 42
static bool
is(string $check)
Check if is a specific HTTP method, HTTPS, and xmlhttprequest (Depends on how an ajax call was made)
at line 72
static string|null
header($name, $alternative = null)
Get HTTP headers from current request
at line 83
static string|null
query()
Get querystring, this method is useful for anyone who uses IIS.
at line 101
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
at line 114
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');
at line 126
static mixed
cookie(string $key, mixed $alternative = null)
Get a value from $_COOKIE
(support path using dots)
at line 137
static mixed
file(string $key)
Get a value from $_FILES
(support path using dots)
at line 173
static resource|bool
raw(bool $binary = true)
Get a value input handler
at line 204
static
json(bool $array = false)
Get a value input handler