mirror of
https://github.com/twigphp/Twig.git
synced 2026-11-03 01:25:04 +00:00
20 lines
879 B
Plaintext
20 lines
879 B
Plaintext
--TEST--
|
|
Omitting parentheses when calling macros is deprecated
|
|
--DEPRECATION--
|
|
Since twig/twig 3.29: Omitting parentheses when calling the macro "hello" is deprecated and will throw a SyntaxError in Twig 4.0; add parentheses after the macro name in "index.twig" at line 4.
|
|
Since twig/twig 3.29: Omitting parentheses when calling a macro is deprecated and will throw a SyntaxError in Twig 4.0; add parentheses after the macro name in "index.twig" at line 5.
|
|
Since twig/twig 3.29: Omitting parentheses when calling the macro "hello" is deprecated and will throw a SyntaxError in Twig 4.0; add parentheses after the macro name in "index.twig" at line 6.
|
|
--TEMPLATE--
|
|
{% import _self as macros %}
|
|
{% set name = 'hello' %}
|
|
{{ macros.hello }}
|
|
{{ _self.(name) }}
|
|
{{ (macros.hello) ?? 'fallback' }}
|
|
{% macro hello() %}Hello{% endmacro %}
|
|
--DATA--
|
|
return []
|
|
--EXPECT--
|
|
Hello
|
|
Hello
|
|
Hello
|