mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 03:46:39 +00:00
22 lines
396 B
Plaintext
22 lines
396 B
Plaintext
--TEST--
|
|
macro with arbitrary arguments
|
|
--TEMPLATE--
|
|
{% from _self import test1, test2 %}
|
|
|
|
{% macro test1(var, ...varargs) %}
|
|
{{- var }}: {{ varargs|join(", ") }}
|
|
{% endmacro %}
|
|
|
|
{% macro test2(...varargs) %}
|
|
{{- varargs|join(", ") }}
|
|
{% endmacro %}
|
|
|
|
{{ test1("foo", "bar", "foobar") }}
|
|
{{ test2("foo", "bar", "foobar") }}
|
|
--DATA--
|
|
return []
|
|
--EXPECT--
|
|
foo: bar, foobar
|
|
|
|
foo, bar, foobar
|