App::post
Usage
mixed App::post(string $key, [?stsring $default = null], [string $filters = 'escape'])Description
Retrieve a variable that was POSTed from the form on the previous page.Parameters
Parameter | Required | Type | Description |
---|---|---|---|
$key | Yes | string | The name of the form field to retrieve. |
$default | No | ?string | The value to return if the key does not exist within the previous form fields. 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 POST form fields
if (!$name = $app->post('full_name')) {
throw new Exception("You did not specify a name.");
}
$quantity = $app->post('quantity', '1');
$comment = $app->post('comment', null, 'escape.trim.strip_tags');