Skip to content

Commit

Permalink
compactify assignments readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pantor committed Jun 9, 2021
1 parent 798a0b9 commit b473873
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,7 @@ Inja will throw an `inja::RenderError` if an included file is not found. To disa
Variables can also be defined within the template using the set statment.
```.cpp
render("{% set new_hour=23 %}{{ new_hour }}pm", data); // "23pm"
```

json pointers can be used to set sub-objects:
```.cpp
render("{% set time.start=18 %}{{ time.start }}pm", data); // "18pm"
render("{% set time.start=18 %}{{ time.start }}pm", data); // using json pointers
```

Assignments only set the value within the rendering context; they do not modify the json object passed into the `render` call.
Expand Down

0 comments on commit b473873

Please sign in to comment.