mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 11:27:00 +00:00
29 lines
675 B
Plaintext
29 lines
675 B
Plaintext
--TEST--
|
|
"block" function with a template argument
|
|
--TEMPLATE--
|
|
{{ block('foo', 'included.twig') }}
|
|
{{ block('foo', included_loaded) }}
|
|
{{ block('foo', included_loaded_internal) }}
|
|
{% set output = block('foo', 'included.twig') %}
|
|
{{ output }}
|
|
{% set output = block(name='foo', template='included.twig') %}
|
|
{{ output }}
|
|
{% set output = block(template='included.twig', name='foo') %}
|
|
{{ output }}
|
|
{% block foo %}NOT FOO{% endblock %}
|
|
--TEMPLATE(included.twig)--
|
|
{% block foo %}FOO{% endblock %}
|
|
--DATA--
|
|
return [
|
|
'included_loaded' => $twig->load('included.twig'),
|
|
'included_loaded_internal' => $twig->load('included.twig'),
|
|
]
|
|
--EXPECT--
|
|
FOO
|
|
FOO
|
|
FOO
|
|
FOO
|
|
FOO
|
|
FOO
|
|
NOT FOO
|