Fabien Potencier 291bbe5b8e feature #3019 Local macros auto-import (fabpot)
This PR was squashed before being merged into the 2.x branch (closes #3019).

Discussion
----------

Local macros auto-import

closes #1758, closes #861

This implements auto-import for macros defined in a template. To avoid BC breaks, I've decided to do the auto-import as the equivalent of `{% import _self as _self %}`, so local macros are loaded under the `_self` pseudo-variable:

```twig
{{ _self.hello("Fabien") }}

{% macro hello(name) -%}
    Hello {{ name }}
{% endmacro %}
```

~~Note that this is done via a new extension that you need to explicitly enable for now. We can remove the need for the extension, just not sure if we want it. WDYT?~~

Commits
-------

3fcbc442 Local macros auto-import
2019-05-18 15:49:37 +02:00
2019-05-18 15:49:29 +02:00
2019-03-20 19:20:25 +01:00
2019-05-18 15:49:29 +02:00
2019-05-18 15:49:29 +02:00
2019-02-15 06:17:13 +01:00
2019-05-14 08:46:40 +02:00
2019-05-18 15:49:29 +02:00
2019-05-17 08:23:38 +02:00
2019-05-01 15:44:34 +02:00
2019-01-01 18:34:43 +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: https://twig.symfony.com/documentation
Languages
PHP 99.9%