Skip to content

Instantly share code, notes, and snippets.

@failpunk
Created July 23, 2013 18:33
Show Gist options
  • Save failpunk/6064914 to your computer and use it in GitHub Desktop.
Save failpunk/6064914 to your computer and use it in GitHub Desktop.
<?php
/*
* ROUTING
*/
$app->get('/archive/{year}/{month}', function($month, $year) {
// ...
})
->bind('archives') // Route name
->value('year', date('Y')) // Default parameter value
->value('month', date('m'))
->assert('year', '\d{4}') // Parameter format
->assert('month', '\d{2}');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment