Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting the optional default value parameter #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion 05-request/05-variables/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<?php
$paramValue = $app->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:

<?php
Expand Down