[TYPO3-mvc] NumberChoiceViewHelper

Sebastian Schreiber me at schreibersebastian.de
Sun Feb 20 10:07:44 CET 2011


Hi,
could be a way.
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?




Am 20.02.2011 09:53, schrieb Georg Ringer:
> Hi,
>
> what about
> -------------
> <f:translate key="{f:if(condition: '{f:count(subject: newsByMonth)} == 
> 1', then: 'entry', else: 'entries')}" />
> -------------
>
> Georg
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


-- 
Sebastian Schreiber
(Medieninformatiker)
(TYPO3 Certified Integrator)

Sülzburgstraße 36
D-50937 Köln

T  0221 677 88 541
M  0176 431 05 790

Skype schreibersebastian.de

me at schreibersebastian.de
www.schreibersebastian.de

Steuernummer: 219 / 5302 / 2302



More information about the TYPO3-project-typo3v4mvc mailing list