Closed entraigas closed 10 years ago
Yes, absolutely - I do this all the time, like /posts/{id}/edit
, etc. but since Bullet parses only one path segment at a time, your routes would have to look like this:
$app->path('blog', function($request) use($app) {
$app->path('articles', function($request) use($app) {
//GET blog/articles/123
$app->param('int', function($request, $articleId) use($app) {
//GET blog/articles/123/comments
$app->path('comments', function($request) use($app, $articleId) {
//return all comments from article 123
});
});
});
});
Thank you!! I'm starting to build a small web system using Bullet.
Good luck, and let me know if you need help with any other questions! :)
Yes, I read the docs and it's not there... Lets say I have a blog and I want to fetch all comments from a given article. The URL is something like GET /blog/article/{id}/comments I wonder if this is possible to define an
$app->path
inside an$app->param
. Something like this: