Request
in package
Table of Contents
- $params : mixed
- $pathParams : mixed
- $post : mixed
- $query : mixed
- $instance : mixed
- addPathParams() : void
- Adds the parameters found in the URL via rewrites.
- get() : Request
- Get the current instance or create one.
- getBody() : mixed
- Get the request body
- getScheme() : string
- Get the current request's scheme from superglobals.
- initParams() : void
- Initialize instance values based on superglobals.
- method() : string
- Get the current request's method from superglobals.
- param() : mixed
- Get a variable from the parameters bag.
- path() : string
- Get the current url's path.
- post() : mixed
- Get a parameter from the POST variables ($_POST)
- query() : mixed
- Get a parameter from the querystring ($_GET)
- resetInstance() : Request
- Recreate the request instance.
- __construct() : mixed
Properties
$params
public
mixed
$params
$pathParams
public
mixed
$pathParams
$post
public
mixed
$post
$query
public
mixed
$query
$instance
protected
static mixed
$instance
Methods
addPathParams()
Adds the parameters found in the URL via rewrites.
public
addPathParams([array<string|int, mixed> $params = [] ]) : void
Eg: /users/:id/edit (param id = 1)
Parameters
- $params : array<string|int, mixed> = []
Return values
void —get()
Get the current instance or create one.
public
static get() : Request
Return values
Request —getBody()
Get the request body
public
getBody() : mixed
Return values
mixed —getScheme()
Get the current request's scheme from superglobals.
public
static getScheme() : string
Return values
string —initParams()
Initialize instance values based on superglobals.
public
initParams() : void
Return values
void —method()
Get the current request's method from superglobals.
public
static method() : string
Return values
string —param()
Get a variable from the parameters bag.
public
param(mixed $name[, null $default = null ]) : mixed
Parameters
- $name : mixed
- $default : null = null
Return values
mixed —path()
Get the current url's path.
public
path() : string
Eg: https://somesite.com/path/to/url The path would be '/path/to/url'
Return values
string —post()
Get a parameter from the POST variables ($_POST)
public
post(mixed $name[, null $default = null ]) : mixed
Parameters
- $name : mixed
- $default : null = null
Return values
mixed —query()
Get a parameter from the querystring ($_GET)
public
query(mixed $name[, null $default = null ]) : mixed
Parameters
- $name : mixed
- $default : null = null
Return values
mixed —resetInstance()
Recreate the request instance.
public
static resetInstance() : Request
Return values
Request —__construct()
protected
__construct() : mixed