From c3df8efbb2e9df44e5c7ae7b3e1081f122e47d3f Mon Sep 17 00:00:00 2001 From: Gebolze Date: Thu, 14 Mar 2024 12:13:03 +0100 Subject: [PATCH] Updated README with documentation of the from tag --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ec112fc1..4864293e 100644 --- a/README.md +++ b/README.md @@ -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