Support for dinamyc Twig template with comments

Hello,


Right now I'm in a project that is CMS, in which the path for the template is dynamic.

Example:

 

 

There is some way to fix it so that it does not show this error, and can use autocomplete, a solution would be to use:

{# @var theme "themes/mytheme/" #}

But this solution is already used for objects which work correctly, it would be ideal to add it for dynamic paths.

 

 

4 comments

Hi there,

Have a look a Symfony plugin -- it adds extra stuff for Twig files and should support this (at very least for the Symfony based projects; but I believe that such setting can be applied to any Twig files/configured separately).

0

Yes the symfony plugin has to add Path to the general level. And it can be useful for a while.


The problem is that if I'm in the folder /themes/mytheme1/ and I assigned the path theme for /themes/mytheme1/, all right up to here, but if I'm under the folder /themes/mytheme2/ that path no longer works, so the ideal would be at the level of the template twig with comments as the example above, it would be a good idea.

0

That is not possible.

You need to file Feature Request at either Symfony plugin tracker (as that extra support comes from that plugin) .. or JetBrains one (base Twig support).

0

Thanks I did it in Symfony Plugin

0

Please sign in to leave a comment.