Skip to content

Instantly share code, notes, and snippets.

@alanpich
Created November 2, 2012 17:15
Show Gist options
  • Save alanpich/4002854 to your computer and use it in GitHub Desktop.
Save alanpich/4002854 to your computer and use it in GitHub Desktop.
SlimPHP optional path params
/*@var $controllers Array of String */
/**
* Set up Slim listeners for each controller
*/
foreach($controllers as $C){
// Map GET
$slim->get("/$C/:id/:relation",function($id,$relation){
print_r(array(
'id' => $id,
'relation' => $relation
));
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment