mirror of
https://github.com/pantor/inja.git
synced 2026-02-17 09:03:58 +00:00
Fix error in example for included templates (#122)
When using templates from an environment, `inja::env::render` must be used. Closes #121
This commit is contained in:
@@ -168,7 +168,7 @@ render("{% include \"footer.html\" %}", data);
|
||||
// To include in-memory templates, add them to the environment first
|
||||
inja::Template content_template = env.parse("Hello {{ neighbour }}!");
|
||||
env.include_template("content", content_template);
|
||||
render("Content: {% include \"content\" %}", data); // "Content: Hello Peter!"
|
||||
env.render("Content: {% include \"content\" %}", data); // "Content: Hello Peter!"
|
||||
```
|
||||
|
||||
### Functions
|
||||
|
||||
Reference in New Issue
Block a user