store result of evaluation in myVar
{mpf:set=myVar||data={mpf:eval=3*5} CHF}
store result in session variable myVar
{mpf:set=session/myVar||data={mpf:eval=3*5} CHF}
store section in myVar (use with closing token)
{mpf:set=myVar}
... {mpf:basket_total} CHF ...
{/mpf:set=myVar}
create an array out of a comma separated string
{mpf:set=myVar||data=String A,String B,String C||explode=,}
Array variables can now be accessed as follows:
{mpf:myVar/1} -> String A
{mpf:myVar/2} -> String B
{mpf:myVar/3} -> String C
list all items of that array:
{mpf:myVar||!=}
key: {mpf:var/key}
value: {mpf:var/val}
{/mpf:myVar||!=}
accessing stored values
set-token does not return a value. See the following page on how to retrieve variable values
|