Reputation: 16495
I am quite new to Typo3 and Fluid, but I guess what I am after is quite basic.
As an Analogy: Twig can extended, so it is possible to create a custom function which can be used like that:
{% set id = uid() %}
<input id="{{ id }}" … /><label for="{{ id }}">…</label>
Is such a thing possible with Fluid? Do I need to install other extensions, or can that be done with basic fluid extension?
Upvotes: 0
Views: 223
Reputation: 6460
In Fluid you have two ways to achieve this:
You can also combine these two and store the result of a viewhelper call in a variable using the f:variable
viewhelper (more usage examples):
<f:variable name="myvariable">{acme:custom.viewhelper()}</f:variable>
In this specific case you can also install the VHS extension, the swiss army knife of Fluid, and use its UniqIdViewHelper
Notice that you normally don't need this for forms since you bind them to (domain) objects you want to create/edit and let Extbase/Fluid handle the rest.
Upvotes: 1