App::pathParam
Usage
mixed App::pathParam (string $key, [?stsring $default = null], [string $filters = 'escape'])Description
Retrive value of a dynamic path parameter that's defined within the /boot/routes.yml file.Parameters
Parameter | Required | Type | Description |
---|---|---|---|
$key | Yes | string | The name of the dynamic path parameter. |
$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 dynamic path parameter.Examples
Get values of some dynamic path parameters.
$category = $app->pathParam('category', 'all');
$product_id = $app->pathParam('product_id');