[TYPO3-mvc] RFC: join view helper

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Sat Jan 9 16:58:10 CET 2010


Very nice, I like it!

Martin Kutschker schrieb:
> Hi!
> 
> I propose a view helper to join arrays in an easy way.
> 
> Shortest possible syntax:
> 
> <f:join each="{0: 'apple', 1: 'banana'}" by=" and " />
> 
> Typical syntax:
> 
> <f:join each="{0: 'apple', 1: 'banana'}" as="fruit" by=" and " >{fruit}</f:join><br>
> 
> Long syntax:
> 
> <f:join each="{0: 'apple', 1: 'banana'}" as="fruit">
>  <f:item>{fruit}</f:item>
>  <f:by> and </f:by>
> </f:join>
> 
> I have created a view helper for this syntax in my example extension "ballroom dancing".
> 
> Perhaps an optional argument "lastBy" eases things even more:
> 
> <f:join each="{0: 'apple', 1: 'banana', 2: 'mango'}" by=", " lastBy=" and " />
> 
> Which would yield: "apple, banana and mango"
> 
> Masi


More information about the TYPO3-project-typo3v4mvc mailing list