[TYPO3-mvc] Last element with for-ViewHelper
Martin Kutschker
masi-no at spam-typo3.org
Fri Jan 15 11:59:19 CET 2010
David Schreiber schrieb:
> Hello Everybody,
>
> I have some rather small problem with building a list of tags, with
> use of the Fluid for-ViewHelper.
>
> My template works like this:
>
> <f:for each="{tags}" as="tag">{tag.name}, </f:for>
>
> This creates me following lists:
>
> Tag1, Tag2, Tag3, Tag4,
>
> How can I make this list, without the trailing comma at the end of it?
> Is there a way to achieve a special handling for the last item of a
> for-each construct?
Not yet, but you can copy the "join" view helper to your project. Either from the FLUID issue
tracker or from my demo extension "ballroom_dancing".
Similar code is floating around in other extensions.
Masi
More information about the TYPO3-project-typo3v4mvc
mailing list