Reputation: 333
I'm beginning to work with Symfony 3. Testing routes, I created one with defaults as following:
index:
path: /test/{name}
defaults: { _controller: MainBundle:Advert:index, name: maxime }
The route works with:
But not with
Any idea why ? thanks
Upvotes: 0
Views: 715
Reputation: 1529
This is documented here https://symfony.com/doc/master/routing/optional_placeholders.html
Routes with optional parameters at the end will not match on requests with a trailing slash (i.e. /blog/ will not match, /blog will match).
If you do need to match even /test/
you can add the following route entry
index_trailing_slash:
path: /test/
defaults: { _controller: MainBundle:Advert:index, name: maxime }
Upvotes: 2