[TYPO3-dev] Call Fluid view-helper in attribute

Christian Opitz - Netzelf christian.opitz at netzelf.de
Tue Sep 21 23:45:40 CEST 2010


  Hi list,

is there a way to call view helpers in tag-attributes in any tag with 
fluid?

<!-- What i want to do is: -->
<submit value="{translate('submit')}"/>

The upper is how i'm used to such tasks in mxml and i don't see fluid so 
far from it. Would be nice if there was a way to do that.

I tryed the upper example but it does not work :( So i would like to put 
sth. on the fluid-wishlist: Making it possible to call view-helpers by 
evaluating the {}-contents and invoking a view-helper if called. To 
distinguish between the namespaces the functions could be prefixed too:
<submit value="{f.translate('submit')}"/>

BTW: A shorthand if/then/else in {}-brackets would be very handy too:
<input name="foo" class="{errors.foo ? 'error' : ''}" value="{gp.foo ? 
gp.foo : translate('foo')}"/>

BTW2: Is there a chance that we could use real XML-namespaces instead of 
those in brackets so that s.o. could write a DTD/XSD for fluid and 
IDEs/editors could validate fluid-templates against those? Would be 
really great if pressing ctrl+space could get me some code-suggestions 
instead of xml-warnings.

Cheers,
Christian




More information about the TYPO3-dev mailing list