Author Topic

Gaetano Giunta

Sunday 02 August 2009 1:44:22 pm

Comment49308

There is a logical difference first of all:
- template operator: a 'decorator' of the input it receives, or a simple operation
- fetch function: accesses info from db or external resource (eg. via webservice). It needs to be tied to a module, too
- plain template function: more complex and powerful operations relating usually to the templating system rather than the content system

As for the differences in coding:
- there is a wizard that allows to create easily template operators, there is none for functions/fetch functions
- for fetch functions otoh the API is simpler, as you can register any php function you like. You will need to create a function_definition.php file in your module dir; take existing function_definition.php files as an example
- template functions are defined via the $eZTemplateFunctionArray variable in the same eztemplateautoload.php file where template operators are defined

Principal Consultant International Business
Member of the Community Project Board