Problem/Motivation
According to the Twig documentation, Twig tags shouldn't output anything directly. Tags do something with or modify the tag's contents.
In #2821512: Create alternative to Twig include function to improve Drupal integration, we can see that the added {% theme %}
tag was modeled after Twig's include tag.
However,Twig's include Tag docs have been updated to say:
The include function is semantically more "correct" (including a template outputs its rendered contents in the current scope; a tag should not display anything)
That note is describing why {{ include() }}
is semantically more correct than {% include %}
.
That means our theme function is semantic, but our theme tag is not.
Proposed resolution
We should remove the theme tag in favor of the theme function that already exists.
User interface changes
None.
API changes
Removes {% theme %}
tag from 8.x-2.x. Marks it as deprecated in 8.x-1.x.
Comment | File | Size | Author |
---|---|---|---|
#3 | 3090458-3.patch | 3.05 KB | JohnAlbin |
|
Comments
Comment #2
JohnAlbinComment #3
JohnAlbinComment #5
JohnAlbin