Navigate to twig include file with twig namespace

Hello guys,

my question is about quick navigation to an twig include file that is defined with a twig namespace, e.g.:

1) in php, I added a twig path to the Twig_Load_Filesystem like this:

$loader = new Twig_Loader_Filesystem([
__DIR__ . '/./',
__DIR__ . '/../app/assets/templates'
]);

$loader->addPath(__DIR__ . '/../app/assets/templates', 'stream');

2) In my twig file I can include any twigfile inside this folder through the @stream namespace:

{% include '@stream/test.twig' %}

 

But: Selecting NAVIGATE->DECLARATION does only show ´cannot find declaration to go to´....

So, my question, is it possible to configure phpstorm to follow this twig-namespaces?

Thank you!

0
3 comments

Hi there,

Maybe Symfony plugin can help as it provides extra Twig support .. but I'm not sure at all if it will work with non Symfony code though...

Otherwise -- no (at very least I know none)

0
Avatar
Permanently deleted user

Hello,

This request is definitely related: https://youtrack.jetbrains.com/issue/WI-7093. Please vote and comment for it in order to move it up in the queue and receive notifications regarding the progress of the feature. See more information on working with tracker at <https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications>.

0

Andriy, thank you a lot. After installing symfony plugin for phpstorm and DISabling all that stuff I do not need (just left twig support enabled) I was able to add a path for a twig namespace in the symfony plugin preferences, so now it works like a charm and out of the box!

Thank you Vladimir too.

1

Please sign in to leave a comment.