mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-11 18:06:46 +00:00
261c4ec92df69b5274d5830ee2b9b1d67cdc5d05
This PR was squashed before being merged into the 2.x branch (closes #2415).
Discussion
----------
Add error message when calling parent() in a block that doesn't exist
Related: #2309
When calling `parent()` in a block that isn't defined in the parent template, you get an error message that states `Block "%s" on template "%s" does not exist`, even if the block is wrapped in an `is defined` check, which is confusing and makes debugging hard.
This fix adds a better error message indicating that you should not call `parent()` when the parent block is not defined.
Before:

After:

Commits
-------
4587f676 Add error message when calling parent() in a block that doesn't exist
Twig, the flexible, fast, and secure template language for PHP ============================================================== Twig is a template language for PHP, released under the new BSD license (code and documentation). Twig uses a syntax similar to the Django and Jinja template languages which inspired the Twig runtime environment. More Information ---------------- Read the `documentation`_ for more information. .. _documentation: http://twig.sensiolabs.org/documentation
Description
Languages
PHP
99.9%