10000 [Twig] variables in host not being set. I have to explicit pass them to path twig function. · Issue #7363 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Twig] variables in host not being set. I have to explicit pass them to path twig function. #7363

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
brpaz opened this issue Mar 13, 2013 · 1 comment
Labels

Comments

@brpaz
Copy link
brpaz commented Mar 13, 2013

HI.
I am trying to make some routes of my application to require a subdomain.
I have added this to my routing.yml

my_route:
resource: "@MyBundle/Resources/config/routing.yml"
host: "{subdomain}.{domain}"
prefix: /some-path
requirements:
domain: %domain%
subdomain: .+

The route is matched correctly but when I try to use path in twig it shows the folloing error:
An exception has been thrown during the rendering of a template ("Some mandatory parameters are missing ("subdomain", "domain")

The host shouldnt be set automaticly? Even using the url function instead of path shows me the same error.
I have to explicity add the subdomain and domain parameters to the path twig function.

Is there an easier way?

@Tobion
Copy link
Contributor
Tobion commented Mar 18, 2013

Duplicate of #6857. Please use the search next time.

@Tobion Tobion closed this as completed Mar 18, 2013
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

2 participants
0