ez.no / exponential / documentation / reference / template functions / variables / append-block
{append-block [name=value1] scope=[global|root|relative] variable=value2}
...tpl code
{/append-block}
| Name | Type | Description | Required |
|---|---|---|---|
| name | string | Name of namespace | no |
| scope | scope of name | no | |
| variable | string | name of variable to return | yes |
Append the rendered output of the block as a new element in the named array
Similar to set-block but will create an array out of all appends instead of overriting old values
example
In this example we will create an array named text, in the namespace MyNameSpace. This array will include two elements
{append-block name=MyNameSpace scope=root variable=text} Initial variable content {/append-block} {append-block name=MyNameSpace scope=root variable=text} some more content {/append-block} output:<br/> {section var=element loop=$MyNameSpace:text} {$element}<br/> {/section}
The output of the previous example is:
output: Initial variable content some more content
Log in or create a user account to comment.
Comments