-
Notifications
You must be signed in to change notification settings - Fork 9
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
Absolute Twig template path causes "Unable to find template file" #46
Comments
Full error output:
|
Changing twig.yaml to relative paths avoids this issue: twig:
# ...
paths: ['templates'] # no %kernel.project_dir% !
# ... But lots of examples still show absolute paths. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using Twig Component
name_prefix
and an absolute Twig template path,the bundle generates invalid internal paths
causing "Unable to find template file" errors.
The problem seems to stem from this line introduced in v0.1.2:
117c5a4#diff-128f62b2acd2d7742958dd6811d5271872143ab21521bb45f19231cbfb6e2281R32
Here, the twig.yaml
paths
are always prefixed with the project root dir.This didn't happen before (when the template paths were ignored and
join(projectDir, 'templates', templateDirectory)
was used instead).This works fine if the
paths
setting has relative paths only --it breaks if there's an absolute path like in our twig.yaml config:
This gets resolved to
/home/mle/project/home/mle/project/templates/components/
which doesn't exist of course.Our twig_component.yaml file:
The text was updated successfully, but these errors were encountered: