Tuesday 04 December 2007 3:05:34 pm
Hiya Jough,
Try this page: http://ez.no/fr/ezpublish/documentation/development/extensions/template_operator It is a good simple exemple for hello world. Basically, an operator is a function which can be used in your template:
You will find a list of the pre-built operators here: http://ez.no/doc/ez_publish/technical_manual/3_10/reference/template_operators
To use your operator in the template once created you simply need to do something like: {def $my_variable = my_operator('my_parameter1', 'my_parameter2')}
You can then display you result
like this: {$my_variable} or {$my_variable|attribute(show)} if you are returning an array
As explained in the above hello world exemple: you will need to create your operator in the
/extension folder
you will need to tell the system that you have an operator in the extension/myextension/settings/site.ini.append
And place your extension in the folder: extension/myextension/autoloads Once you have created your extension don't forget to activate it by going to the administration interface -> setup -> extensions -> tick and activate -> clear cache Let us know how you get on!
|