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

Add leading slash if missing in route patterns #1967

Closed
wants to merge 1 commit into from

Conversation

vlakoff
Copy link
Contributor

@vlakoff vlakoff commented Aug 20, 2016

This PR allows to omit the leading slash when defining routes.

For the record, I have a lot of routes like so:

$app->get('/about', function () {
    return view('about');
});

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 97.183% when pulling 50e06be on vlakoff:routing into 1dedd25 on slimphp:3.x.

@vlakoff
Copy link
Contributor Author

vlakoff commented Aug 20, 2016

Wow, that's an impressive testing suite!

@mathmarques
Copy link
Contributor

Route pattern is just a simple concatenation. See this for more information.

Slim used to do the way you proposed, but it's better without all the "magic".

@vlakoff
Copy link
Contributor Author

vlakoff commented Aug 20, 2016

Yes this "no magic" approach seems to have many advantages. I'll live with the leading slash.

Thanks for pointing this out.

@vlakoff vlakoff closed this Aug 20, 2016
@vlakoff vlakoff deleted the routing branch August 20, 2016 02:17
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

Successfully merging this pull request may close these issues.

None yet

3 participants