mirror of
https://github.com/pantor/inja.git
synced 2026-02-17 09:03:58 +00:00
change readme example
This commit is contained in:
@@ -187,8 +187,8 @@ render("{% include \"footer.html\" %}", data);
|
||||
If a corresponding template could not be found in the file system, the *include callback* is called:
|
||||
```.cpp
|
||||
// The callback takes the current path and the wanted include name and returns a template
|
||||
env.set_include_callback([&env](const std::string& path, const std::string& name) {
|
||||
return env.parse("Hello {{ name }} from " + name);
|
||||
env.set_include_callback([&env](const std::string& path, const std::string& template_name) {
|
||||
return env.parse("Hello {{ neighbour }} from " + template_name);
|
||||
});
|
||||
|
||||
// You can disable to search for templates in the file system via
|
||||
|
||||
Reference in New Issue
Block a user