mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 19:06:40 +00:00
17 lines
434 B
Plaintext
17 lines
434 B
Plaintext
--TEST--
|
|
macro explicit variadic argument also collects named arguments
|
|
--TEMPLATE--
|
|
{% from _self import attributes %}
|
|
|
|
{% macro attributes(...attrs) -%}
|
|
{% for name, value in attrs %}{{ name }}={{ value }}{{ not loop.last ? ' ' }}{% endfor %}
|
|
{%- endmacro %}
|
|
|
|
{{ attributes(id: "main", class: "box") }}
|
|
{{ attributes(blocks: "list", varargs: "extra") }}
|
|
--DATA--
|
|
return []
|
|
--EXPECT--
|
|
id=main class=box
|
|
blocks=list varargs=extra
|