[TYPO3-mvc] NumberChoiceViewHelper

Marc Bastian Heinrichs typo3 at mbh-web.de
Sun Feb 20 11:32:34 CET 2011


Hey,

> But we i think in my case we have more than two states:
> We have at least 0, 1, and infinite+.
> And i would like to substitute some arguments dynamically.
>
> Since i like symfony very much, i converted the
> NumberChoiceViewHelper of symfony to fluid.
> With this solution we have to call it this way:
> <prod:format.numberChoice
> text="{f:translate(key: 'numberOfArticles', default: '[0]No Articles >
in this category|[1]There is 1 article in this category|(1,+Inf]There
> are _number_ articles in this category')}"
> arguments="{_number_: category.numberOfArticles}"
> number="{category.numberOfArticles}" />
>
> What do you think about it?

I like the idea of an NumberChoiceViewHelper and Christian Zenker
already backported the Symfony helper
http://git.typo3.org/FLOW3/Packages/ViewhelperIncubator.git?a=commit;h=3071aceca9e22280b5cd06d7734c942db8ea79c9
Btw. same argument names like you used.

But I don't think, that the notation of the conditions follows the
general approach of fluid.


Best
Marc Bastian




More information about the TYPO3-project-typo3v4mvc mailing list