Skip to content

Commit

Permalink
Updated README with documentation of the from tag
Browse files Browse the repository at this point in the history
  • Loading branch information
gebolze committed Mar 15, 2024
1 parent 94d18e7 commit c3df8ef
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,18 @@ Now `field` is available as a local property of the template and can be invoked
{{ field('pass', type='password') }}
```

> Macros need to be defined before they are used as they are discovered as the template is executed. They can also be defined in external templates and imported using the `{% include %}` tag.
> Macros need to be defined before they are used as they are discovered as the template is executed.
### Importing functions from external templates
Macros defined in an external template **must** be imported before they can be invoked.

```
{% from 'forms' import field %}
{{ field('user') }}
{{ field('pass', type='password') }}
```


### Extensibility

Expand Down

0 comments on commit c3df8ef

Please sign in to comment.