mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-09 08:56:47 +00:00
17 lines
456 B
Plaintext
17 lines
456 B
Plaintext
--TEST--
|
|
"include" function accept variables and with_context
|
|
--TEMPLATE--
|
|
{{ include("foo.twig") }}
|
|
{{- include("foo.twig", with_context = false) }}
|
|
{{- include("foo.twig", {'foo1': 'bar'}) }}
|
|
{{- include("foo.twig", {'foo1': 'bar'}, with_context = false) }}
|
|
--TEMPLATE(foo.twig)--
|
|
{% for k, v in _context %}{{ k }},{% endfor %}
|
|
--DATA--
|
|
return ['foo' => 'bar']
|
|
--EXPECT--
|
|
foo,global,_parent,
|
|
global,_parent,
|
|
foo,global,foo1,_parent,
|
|
foo1,global,_parent,
|