Files
Twig/tests/Fixtures/macros/dynamic_call_without_parentheses.test
2026-07-28 16:39:05 +02:00

12 lines
371 B
Plaintext

--TEST--
Calling a dynamic macro without parentheses is forbidden
--TEMPLATE--
{% import _self as macros %}
{% set name = 'hello' %}
{{ macros.(name) }}
{% macro hello() %}Hello{% endmacro %}
--DATA--
return []
--EXCEPTION--
Twig\Error\SyntaxError: Omitting parentheses when calling a macro is not allowed; add parentheses after the macro name in "index.twig" at line 4.