Skip to content
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

Update documentation to remove reference to relative twig paths #138

Open
developedsoftware opened this issue Aug 1, 2022 · 1 comment
Labels
status:ready for adoption Feel free to implement this issue. type:docs Documentation

Comments

@developedsoftware
Copy link

As mentioned here twigphp/Twig#3730 (comment)

And also referencing issue #137

We have been trying to use relative paths in twig files as per the documentation below. Only to find out that twig does not actually support relative paths in twig files.

https://www.yiiframework.com/extension/yiisoft/yii2-twig/doc/guide/2.3/en/template-syntax#referencing-other-templates

In the first case the view will be searched relatively to the current template path. For comment.twig and post.twig that means these will be searched in the same directory as the currently rendered template.

Whilst I assume the above means, in the same path of the "first" rendered template (because that actually works). If you in root_folder/A.twig include a twig file (some_relative_folder/B.twig), and inside that twig file include another twig file (C.twig) you would expect it to look in some_relative_folder, but it only looks in root_folder and then errors saying it cannot find C.twig.

Should the documentation be updated to make that more clear? It defo tripped us up (we are not using aliases everywhere!)

@bizley bizley added type:docs Documentation status:ready for adoption Feel free to implement this issue. labels Aug 1, 2022
@samdark
Copy link
Member

samdark commented Aug 1, 2022

Yes, needs to be updated. Would appreciate a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue. type:docs Documentation
Projects
None yet
Development

No branches or pull requests

3 participants