10000 Namespaced template names don't work when twig and php are selected as templating engine · Issue #8892 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Namespaced template names don't work when twig and php are selected as templating engine #8892

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
DemonTPx opened this issue Aug 30, 2013 · 7 comments

Comments

@DemonTPx
Copy link
Contributor

I have this set in my config.yml:

framework:
    templating:
        engines: ['twig', 'php']

When I try this in my controller:

$this->render('@MyTools/Tools/index.html.twig');

... I get the following error:

Template name "@MyTools/Tools/index.html.twig" is not valid (format is "bundle:section:template.format.engine").

Removing 'php' from the engines solves the problem and using the old template name style ('ToolsBundle:Tools:index.html.twig') also solves it.

@sstok
Copy link
Contributor
sstok commented Aug 30, 2013

The title is wrong as its not a route but a path, and this a known issue.
@bundle-name for templates only works for Twig and not for other engines.

If only twig is enabled it will use the Twig filesystem loader which is the only engine at this moment who supports it.

#7818 #6919

@DemonTPx
Copy link
Contributor Author

I've updated the title. It may be a known issue, but for me it was not clear that having php enabled as templating engine caused the issue.

@stof
Copy link
Member
stof commented Aug 30, 2013

It is not a route path, it is a template name.

@DemonTPx
Copy link
Contributor Author

Oops! Fixed it.

@javiereguiluz
Copy link
Member

Unless this is easy to fix it, I think we should close it as won't fix. It's an edge case probably used by few people and it's now documented here: symfony/symfony-docs#4220

@fabpot
Copy link
Member
fabpot commented Sep 16, 2014

@javiereguiluz I agree with you.

@fabpot fabpot closed this as completed Sep 16, 2014
@stof
Copy link
Member
stof commented Sep 16, 2014

Actually, I think it might be an easy fix

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

No branches or pull requests

5 participants
0