Skip to content
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

Open
gracedigital opened this issue Jan 21, 2016 · 3 comments
Open

Route Expression for list with pattern? #23

gracedigital opened this issue Jan 21, 2016 · 3 comments

Comments

@gracedigital
Copy link

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]+]}

@sinmetal
Copy link
Contributor

@gracedigital
Slim3's framework for Google App Engine for Java

Is the Example that you are writing JavaScript code?

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();
});

Slim3 URL Mapping Document

@gracedigital
Copy link
Author

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 <[email protected]mailto:[email protected]>
Reply-To: Slim3/slim3 <[email protected]mailto:[email protected]>
Date: Thursday, January 21, 2016 at 4:31 PM
To: Slim3/slim3 <[email protected]mailto:[email protected]>
Cc: Developer <[email protected]mailto:[email protected]>
Subject: Re: [slim3] Route Expression for list with pattern? (#23)

@gracedigitalhttps://github.com/gracedigital
Slim3's framework for Google App Engine for Javahttps://cloud.google.com/appengine/docs/java/gettingstarted/introduction

Is the Example that you are writing JavaScript code?

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();
});

Slim3 URL Mapping Documenthttps://sites.google.com/site/slim3appengine/slim3-controller/url-mapping


Reply to this email directly or view it on GitHubhttps://github.com//issues/23#issuecomment-173760983.

@sinmetal
Copy link
Contributor

@gracedigital
URL Mapping of Slim3 only be replaced {id} to ?id={id}
validation of the value is performed in the Controller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants