From 00c6aeab8399895f208f04f556332f19845c9cad Mon Sep 17 00:00:00 2001 From: Jonathan Klein Date: Fri, 28 Mar 2014 14:14:30 -0400 Subject: [PATCH] Documenting the optional default value parameter --- 05-request/05-variables/page.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/05-request/05-variables/page.md b/05-request/05-variables/page.md index eb7fe43..2653cdd 100644 --- a/05-request/05-variables/page.md +++ b/05-request/05-variables/page.md @@ -27,7 +27,16 @@ methods instead: //PUT variable $paramValue = $app->request->put('paramName'); -If a variable does not exist, each method above will return `null`. You can also invoke any of these functions without +If a variable does not exist, each method above will return `null`. Each of these methods also accepts a +default value as its second parameter: + + request->get('paramName', 'default'); + $paramValue = $app->request->post('paramName', 'default'); + $paramValue = $app->request->put('paramName', 'default'); + + +You can also invoke any of these functions without an argument to obtain an array of all variables of the given type: