问题
I've a problem how to model my routes so they get recognized correctly. I've the following routes:
$app->get('/courses/:id', function ($id) use ($app) {
$app->render(200, array("Id parameter"));
});
$app->get('/courses/attendees', function () use ($app) {
$app->render(200, array("attendee Parameter"));
});
$app->get('/courses/search', function () use ($app) {
$app->render(200, array("search Parameter"));
});
If I call the URI localhost/courses/12 I'll get the expected result "Id parameter" but if I call the URI localhost/courses/search or localhost/courses/attendees I still get the same result.
Seems I'm missing something here...
来源:https://stackoverflow.com/questions/26735735/slim-routing-routes-ignored