mirror of
https://github.com/pantor/inja.git
synced 2026-10-13 15:57:14 +00:00
add in-memory includes via include_template
This commit is contained in:
1 parent
95e3712aaf
commit
cb18e2cd0c
3 files changed
+41
-14
No files matched your search
@@ -157,9 +157,14 @@ render("{% if not guest_count %}…{% endif %}", data); // True
|
||||
|
||||
#### Includes
|
||||
|
||||
This includes other template files, relative from the current file location.
|
||||
You can either include other template files or already parsed templates.
|
||||
```
|
||||
{% include "footer.html" %}
|
||||
// Other template files are included relative from the current file location
|
||||
render({% include "footer.html" %}, data);
|
||||
|
||||
// To include in-memory templates, add them to the environment first
|
||||
env.include_template("footer", temp);
|
||||
render({% include "footer" %}, data);
|
||||
```
|
||||
|
||||
### Functions
|
||||
|
||||
Reference in new issue
Block a user