Files
Twig/tests/Fixtures/functions/parent_outside_of_a_block.test
2024-08-26 09:24:03 +02:00

11 lines
282 B
Plaintext

--TEST--
"parent" cannot be called outside of a block
--TEMPLATE--
{% extends "parent.twig" %}
{{ parent() }}
--TEMPLATE(parent.twig)--
--DATA--
return []
--EXCEPTION--
Twig\Error\SyntaxError: Calling the "parent" function outside of a block is forbidden in "index.twig" at line 3.