Saves a value to the current scope for later reference. Optionally applies filters to the value before saving it.
{% var [name] = [value] [| filter1 [: arg [arg...]]] [| filter2 ...] %}
name: The name of the variable to save the value to. If name starts with '&', will attempt to assign the value by reference.
value: The value to assign to the new variable.
May optionally include one or more filters.
The var tag is superior to the assign and set tags in that it will always save the value on the current scope, thereby preventing the variable from being changed on any parent scopes. That is also the reason why you may choose not to use it.
Dynamically render html tags using var
CopyVar date assignment and date math
Copy