Namespaced Twig paths not working
See original GitHub issueFirstly, let me say that this plugin is the very best in terms of Symfony 2 integration and I really enjoy it working with it. Keep up the good work!
There is a small issue with the Twig templates when they are referenced as with their namespaced paths:
in config.yml
twig:
paths:
"%kernel.root_dir%/../src/vendor/bundle/Resources/views": core
in the controllers:
return $this->render('@core/path/template.html.twig');
or in the templates:
{% include '@core/path/template.html.twig' %}
This plugin doesn’t recognise the shortcut. Is it a bug or it is not technically possible to parse the configuration to reference the namespace paths?
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
How to Use and Register Namespaced Twig Paths - Symfony
A single Twig namespace can be associated with multiple paths. The order in which paths are configured is very important, because Twig will...
Read more >adding namespaced twig paths - symfony - Stack Overflow
I do, but I want to keep the default templates path, if I remove the dash, I have an other issue saying that...
Read more >Registering Twig namespaces | Components - Drupal
New in 3.0.0: You can now skip the path to the Twig file if the component is deeply nested in your namespace's path....
Read more >Bundle twig and namespace "There are no registered paths ...
I can't explain it and I'm not aware of having changed anything but it just started working. Egzona ...
Read more >Ability to use Twig namespaces in templates {% include ...
It also seem to return the paths in that namespace when i use getPaths(). But in grav I get: Template "@atoms/test.twig" is not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Is this issue fixed? I’m still having OPs same problem. Any namespaced path defined in
config/packages/twig.yamlare not recognized for autocompletion. As a workaround I have to manually define a namespace and its path in Phpstorm twig config section.Existing bundles are added automatically. E.g. for the SensioDistributionBundle one can reference templates using
@SensioDistribution/path/to/template.html.twig.@Haehnchen Would
fr.adrienbrault.idea.symfony2plugin.TwigHelperbe the correct place to start implementing this?