Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
If you start to learn about twig you probably will always go to http://twig.sensiolabs.org/doc/templates.html
On there the syntax for a extends block is {
{% extends "foo.html"}
In Drupal though you need:
{% extends "foo.html.twig"}
This is somehow a WTF.
Proposed resolution
Allow both, or don't require .twig at all.
Comments
Comment #1
star-szrDoes Symfony (or whatever) actually map foo.html to foo.html.twig? If not I think this is a won't fix or maybe we can do an upstream PR to update the docs :)
Edit: Near the top:
The docs seem to to just use .html. I think this is fine personally.
Comment #2
star-szrComment #3
dawehnerOh I simply assumed that they do some extension mechanism internally, but I guess you are right, they just use the filename and thats it.
At least
\Twig_Loader_Filesystem
seems not to implement something like that.Comment #4
joelpittetNo magic it's just the filename.