$id
$id :
Unique identifier for the request
Request
__construct(array $params_get = array(), array $params_post = array(), array $cookies = array(), array $server = array(), array $files = array(), string $body = null)
Constructor
Create a new Request object and define all of its request data
array | $params_get | |
array | $params_post | |
array | $cookies | |
array | $server | |
array | $files | |
string | $body |
createFromGlobals() : \app\framework\Component\Route\Klein\Request
Create a new request object using the built-in "superglobals"
paramsGet() : \app\framework\Component\Route\Klein\DataCollection\DataCollection
Returns the GET parameters collection
paramsPost() : \app\framework\Component\Route\Klein\DataCollection\DataCollection
Returns the POST parameters collection
paramsNamed() : \app\framework\Component\Route\Klein\DataCollection\DataCollection
Returns the named parameters collection
cookies() : \app\framework\Component\Route\Klein\DataCollection\DataCollection
Returns the cookies collection
server() : \app\framework\Component\Route\Klein\DataCollection\DataCollection
Returns the server collection
headers() : \app\framework\Component\Route\Klein\DataCollection\HeaderDataCollection
Returns the headers collection
files() : \app\framework\Component\Route\Klein\DataCollection\DataCollection
Returns the files collection
params(array $mask = null, boolean $fill_with_nulls = true) : array
Returns all parameters (GET, POST, named, and cookies) that match the mask
Takes an optional mask param that contains the names of any params you'd like this method to exclude in the returned array
array | $mask | The parameter mask array |
boolean | $fill_with_nulls | Whether or not to fill the returned array with null values to match the given mask |
__set(string $param, mixed $value) : void
Magic "__set" method
Allows the ability to arbitrarily set a parameter from this instance while treating it as an instance property
NOTE: This currently sets the "named" parameters, since that's the one collection that we have the most sane control over
string | $param | The name of the parameter |
mixed | $value | The value of the parameter |
method(string $is = null, boolean $allow_override = true) : string|boolean
Gets the request method, or checks it against $is
// POST request example
$request->method() // returns 'POST'
$request->method('post') // returns true
$request->method('get') // returns false
string | $is | The method to check the current request method against |
boolean | $allow_override | Whether or not to allow HTTP method overriding via header or params |