ez.no / exponential / documentation / development / libraries / ez template / basics / functions
These documentation pages are no longer maintained. Please visit the new documentation site.
Functions are template tags that perform code on a set of sub-children, or work stand-alone. Both functions and operators perform code but there are some differences.
Functions take named parameters and can work on sub children elements, that can be functions or text. Operators work like Unix pipes where the data is input in one end, processed and output to either a new operator or to the output. Operators also take sequenced parameters to modify their behaviour. Mixing operators and variable types both as parameter and as input works.
Most functions are stand-alone classes that can be replaced or modified. One internal functions is literal which must be done internally due to parsing issues*.
* A change in the parser might be made to allow for an external literal function.
This example shows usage of the switch function to show conditional content.
{switch match=$match1} {case match=1}Matched 1{/case} {case match=2}Matched 2{/case} {case}Matched default{/case} {/switch}
Comments