Fabien Potencier 261c4ec92d bug #2415 Add error message when calling parent() in a block that doesn't exist (pierredup)
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:
![screen shot 2017-03-08 at 08 08 38](https://cloud.githubusercontent.com/assets/144858/23693410/0e476242-03dd-11e7-9621-4442bdc6bf05.png)

After:
![screen shot 2017-03-08 at 08 56 18](https://cloud.githubusercontent.com/assets/144858/23693424/234d9c2e-03dd-11e7-8d07-4e277d80f7e4.png)

Commits
-------

4587f676 Add error message when calling parent() in a block that doesn't exist
2017-03-10 08:55:37 -08:00
2017-02-23 06:55:46 -08:00
2017-01-04 14:05:59 -08:00
2017-02-17 11:33:43 -08:00
2017-01-02 12:22:20 -08:00
2016-11-19 11:13:58 -08:00
2013-11-11 20:04:42 +01:00

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
Languages
PHP 99.9%