Skip to content

Instantly share code, notes, and snippets.

View Gazer's full-sized avatar
💭
Coding

Ricardo Markiewicz Gazer

💭
Coding
View GitHub Profile
@funkatron
funkatron / slim_catchall_route.php
Created December 8, 2011 14:48
Making a "catchall" route in Slim
<?php
/**
* by setting the regex condition for the :method param to '.+', it matches
* everything, including "/" chars. this lets us match any URL of the format.
*
* /api/foo outputs "foo"
* /api/foo/bar/baz outputs "foo/bar/baz"
*/
$app->get('/api/:method', function($method) use ($app) {
echo $method;