mirror of
https://github.com/sigmasternchen/libparcival
synced 2025-03-15 11:58:53 +00:00
added explaination of render structure block to readme
This commit is contained in:
parent
4e7b006b06
commit
3d8eb31389
1 changed files with 21 additions and 0 deletions
21
README.md
21
README.md
|
@ -95,6 +95,27 @@ Example:
|
||||||
{{ "foo: %s - %d", "bar", 69 }}
|
{{ "foo: %s - %d", "bar", 69 }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Structure Block
|
||||||
|
|
||||||
|
Structure blocks have the following syntax:
|
||||||
|
|
||||||
|
```
|
||||||
|
{# [structure command] ( [parameters] ) #}
|
||||||
|
```
|
||||||
|
|
||||||
|
At the moment there is only one structure command implemented.
|
||||||
|
|
||||||
|
## Render
|
||||||
|
|
||||||
|
Using the render command, a another template can be included at the current position. The first parameter is the name of the template to be included as a string. All following parameters will be used as template parameters.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
{# render("templates/index.html.templ", "Page Title", userArray, userArrayLength) #}
|
||||||
|
```
|
||||||
|
|
||||||
|
All used variables have to be declared (for example as template parameters or local variables of statement blocks).
|
||||||
|
|
||||||
### Complete Example
|
### Complete Example
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue