Slim Routing - Routes ignored

狂风中的少年 提交于 2019-12-13 04:29:54

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!