Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten authored Jun 29, 2016
1 parent 475192e commit ba083d6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ class DashboardController
// GET /dashboard?name=Hello => $dashboardName == "Hello"
$dashboardName = $this->queryParameter('name')->string()->required();

// Get /dashboard?name= => $dashboardName == "default value"
$dashboardName = $this->queryParameter('name')->string()->defaultsToIfEmpty("default value");

// GET /dashboard?status=private => $dashboardStatus == "private"
// GET /dashboard?status=public => $dashboardStatus == "public"
// GET /dashboard?status=invalid => A NotFoundException will be thrown
Expand All @@ -158,7 +161,11 @@ class DashboardController
// GET /dashboard?includeWidgets=abcde => A NotFoundException will be thrown
$includeWidgets = $this->queryParameter('includeWidgets')->boolean()->required();

// GET /image?scale=2.5 => $scale = 2.5
// GET /dashboard?includeWidgets=yes => $includeWidgets == true
// GET /dashboard?includeWidgets=no => $includeWidgets == false
$includeWidgets = $this->queryParameter('includeWidgets')->yesNoBoolean()->required();

// GET /image?scale=2.5 => $scale == 2.5
$scale = $this->queryParameter('scale')->float()->required();
}
}
Expand Down

0 comments on commit ba083d6

Please sign in to comment.