This documentation is not using the current rendering mechanism and will be deleted by December 31st, 2020. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
ViewHelpers of EXT:events2¶
ViewHelpers are used to add logic inside the view. There basic things like if/else conditions, loops and so on. The system extension fluid has the most important ViewHelpers already included.
To be able to use a ViewHelper in your template, you need to follow always the same structure which is:
This would call the ViewHelper fo of the namespace f which stands for fluid. If you want to use ViewHelpers from other extensions you need to add the namespace declaration at the beginning of the template. The namespace declaration for the events2 extension is:
Now you can use a ViewHelper of events2 with a code like:
<e2:trimExplode><!-- some comment --></e2:trimExplode>
If you want to know what a ViewHelper does, it is very easy to find the related PHP class by looking at the namespace and the name of the ViewHelper.
convertToJson you will find the class at
The most of awesome thing is that you can use ViewHelpers of any extension in any other template by just adding another namespace declaration like:
and call the ViewHelper like