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

Optional variable not working as expected/it did previously #195

Open
geckoeffect opened this issue Jun 21, 2017 · 4 comments
Open

Optional variable not working as expected/it did previously #195

geckoeffect opened this issue Jun 21, 2017 · 4 comments

Comments

@geckoeffect
Copy link

This route used to work in a previous version
/client/[a:Action]?/[:ID]?/[**:trailing]?
Accessing the route without an action where if Action wasn't defined it would still find the route eg http://altorouter.com/client
now it only works if you have an action http://altorouter.com/client/list

Adding a / on line 210 so it does a strpos of '[' fixes this issue
210: } elseif (($position = strpos($route, '/[')) === false) {

@YannickFricke
Copy link

YannickFricke commented Jun 22, 2017

Try to use the http://altorouter.com/client/ route. Notice the trailing slash.

@geckoeffect
Copy link
Author

geckoeffect commented Jun 23, 2017

I tired that too, it didn't work... but both work with my suggested code

@YannickFricke
Copy link

@geckoeffect Could you post your routes?

@koenpunt
Copy link
Collaborator

That's interesting. Can you create a PR and then add a test for this behavior?

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

3 participants