Quick example.
<nav>
{{ _self.foo('hi') }}
{# Expected output: <p>hi</p> #}
</nav>
{% macro foo(greeting) %}
{% import _self as bar %}
<p>{{ greeting }}</p>
{% endmacro %}
When defining and using the macro in the same file use _self
. When we say _self
, it's a way of referring to this very template.