8000 Custom paths for Twig files · Issue #7459 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

Custom paths for Twig files #7459

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
ste93cry opened this issue Mar 23, 2013 · 2 comments
Closed

Custom paths for Twig files #7459

ste93cry opened this issue Mar 23, 2013 · 2 comments

Comments

@ste93cry
Copy link
Contributor

Currently all the twig files have to be put inside the Resources/views folder of the app or bundle folder. Some time ago a new option was added to add new paths where the file locator should search for. However, I'm unable to use it because it seems that they are ignored. We can analyze a simple test case where I want to have some templates inside the directory bundle/Resources/templates/mytemplate/views. I add the path to the config, then I render from a controller a template which resides in that folder with the usual string Bundle:MyControllerName:mytemplate.html.twig. This string is then converted to a resource location which starts with the @ and the file locator is called. However when a path starts with that symbol it doesn't call the locate method of the FileLocator class but it calls the locateResource method of the HttpKernel class which knows nothing about the paths and just throws the exception of file not found. Maybe I'm understanding wrong how the paths options should be used: if it's the case, then please help me understand how can I use custom path locations for my templates.

@vicb
Copy link
Contributor
vicb commented Mar 24, 2013

see #6918, #6919

@fabpot
Copy link
Member
fabpot commented Apr 12, 2013

Closing as a duplicate

@fabpot fabpot closed this as completed Apr 12, 2013
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

3 participants
0