Skip to content

Commit

Permalink
Fix doc example about global context in macros (PebbleTemplates#525)
Browse files Browse the repository at this point in the history
Co-authored-by: Victor Grigoriu <grigoriu@adobe.com>
  • Loading branch information
vgrigoriu and Victor Grigoriu authored Jul 25, 2020
1 parent 460f796 commit d6435f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/src/orchid/resources/wiki/tag/macro.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ A macro does not have access to the same variables that the rest of the template
A macro can only work with the variables provided as arguments.

### Access to the global context
You can pass the whole context as an argument by using the special '_context' variable if you need to access
variables outside of the macro scope
You can pass the whole context as an argument by using the special `_context` variable if you need to access
variables outside of the macro scope:
```twig
{% verbatim %}
{% set foo = 'bar' %}
{{ test(_context) }}
{% macro test(_context) %}
{{ foo }}
{{ _context.foo }}
{% endmacro %}
{# will output: bar #}
{%- endverbatim %}
```
```

0 comments on commit d6435f7

Please sign in to comment.