App::get

Usage

mixed App::get(string $key, [?stsring $default = null], [string $filters = 'escape'])

Description

Retrieve a variable contained within the query string (ie. $_GET super global)

Parameters

Parameter Required Type Description
$key Yes string The name of the variable within the query string to retrieve.
$default No ?string The value to return if the key does not exist within the query string. Defaults to null.
$filters No string "Period delimited string of words that denote the filters to apply before returning the value. See the Request Inputs page for available filters.

Return Value

The value of the form field.

Examples

Get values of some variables within the query string.



if (!$id = $app->get('product_id')) { throw new Exception("No product ID specified."); } $quantity = $app->get('quantity', '1');

See Also