I want to add a parameter xyz to some routing rules, but this parameter is not specified in pattern, as follow:
homepage:
pattern: /
defaults: { _controller: MyBundle:Page:home, xyz: true }
contact:
pattern: /contact
defaults: { _controller: MyBundle:Page:contact }
gallery:
pattern: /gallery
defaults: { _controller: MyBundle:Page:gallery, xyz: true }
I tried this routing configuration but my parameter xyz is not posted when calling homepage or gallery URL.
Here is my Twig page (for example):
...
<a href="{{ path('gallery') }}">my test link</a>
...
The result is:
<a href="/gallery">my test link</a>
And I was excepting that when I click on this link, my xyz parameter to be sent.
Any idea why?
Use
attributesparameter bag instead of the GET one