Add the include_only function to render a template without access to the current context

This commit is contained in:
Fabien Potencier
2026-06-04 21:50:17 +02:00
parent 6fafa104c4
commit dc8f96df3e
10 changed files with 187 additions and 48 deletions
@@ -0,0 +1,17 @@
--TEST--
"include_only" function
--TEMPLATE--
FOO
{{ include_only("foo.twig") }}
BAR
--TEMPLATE(foo.twig)--
FOOBAR
--DATA--
return []
--EXPECT--
FOO
FOOBAR
BAR