Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Routing] No route found for an optional parameter #17917

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

Closed
marek-pietrzak-tg opened this issue Feb 24, 2016 · 2 comments
Closed

[Routing] No route found for an optional parameter #17917

marek-pietrzak-tg opened this issue Feb 24, 2016 · 2 comments
Labels

Comments

@marek-pietrzak-tg
Copy link
Contributor

According to http://symfony.com/doc/current/book/routing.html#required-and-optional-placeholders I should be able to have an optional parameter by setting it's default value in defaults.
This seems not working for me anymore.
I was playing with the symfony standard edition as well as vanilla symfony in version 3.0.2

Tested on annotation as well as a yaml routing:

blog:
   path: /blog/{page}
   defaults:  { _controller: AppBundle:Default:blog, page: 1 }

Running: bin/console router:match /blog/2 I get:
screen shot 2016-02-24 at 15 28 58
But bin/console router:match /blog/
gives:

[ERROR] None of the routes match the path "/blog/"   
@marek-pietrzak-tg marek-pietrzak-tg changed the title No route found for an optional parameter [Routing] No route found for an optional parameter Feb 24, 2016
@jakzal
Copy link
Contributor

jakzal commented Feb 24, 2016

see the explanation here #5869 (comment)

@marek-pietrzak-tg
Copy link
Contributor Author

yeah... makes sense. Thanks @jakzal

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

No branches or pull requests

3 participants