I am trying to use slim's route groups, but I am having trouble getting the url parameters to pass anything in.
$app->group('/contest/:id', function($id) use ($API){
error_log('THIS IS THE CONTEST ID: '.$id); // id is blank... why?
$API->authorize('contest', $id);
$contest = new Contest($id);
$app->get('', function() use ($contest, $API){
$data = $contest->getSettings();
$API->output($data);
});
$app->get('/settings', function() use ($contest, $API){
$data = $contest->getSettings();
$API->output($data);
});
$app->get('/stats', function() use ($contest, $API){
$data = $contest->getStats();
$API->output($data);
});
$app->get('/fields', function() use ($contest, $API){
$data = $contest->getFields();
$API->output($data);
});
});
Why can't I access $id in the callback function? Isn't this the point of route groups?