Consider the following example:
1) Create a variable in the current context
{% set x = 42 %}
2) Declare a macro that takes an object as a parameter
{% macro test(variables) %} variable x = {{ variables.x | default('undefined') }} {% endmacro %}
3) Call your macro with a special _context object
{{ _self.test(_context) }}
This will display:
variable x = 42
Alain tiemblo
source share