yiisoft/yii2-twig

Error when including twig files without absolute links

HJPoyntz opened this issue · 1 comments

What steps will reproduce the problem?

Screenshot 2022-07-28 at 15 17 35

With the following file structure.
If I inside of masterTwig.twig include twig-test/A.twig.
Then, inside of A.twig, I reference B.twig with a relative path {% include "B.twig" %}.

What's expected?

This should give me the content of B.twig.
It should also looking inside of the folder twigTest, however it looks in the folder twigContainer

What do you get instead?

The error message that is thrown is:

`Unable to find template "B.twig"(looked into: twigContainer)

Additional info

Q A
Yii version 2.0
Yii Twig version 2.4
Twig version
PHP version 8.1
Operating system MacOS

I think this is solved by the proposed solution #128

Perhaps you should post this issue here instead as I think this is a twig issue and not yii's implentation of twig (i might be wrong) ?

https://github.com/twigphp/Twig/issues