977. Class

977.1. Zend\I18n\View\Helper\Plural

Helper for rendering text based on a count number (like the I18n plural translation helper, but when translation is not needed).

Please note that we did not write any hard-coded rules for languages, as languages can evolve, we prefered to let the developer define the rules himself, instead of potentially break applications if we change rules in the future.

However, you can find most of the up-to-date plural rules for most languages in those links:

977.1.1. Methods

977.1.1.1. setPluralRule

setPluralRule()

Set the plural rule to use

Parameters:PluralRule|string
Return type:Plural

977.1.1.2. __invoke

__invoke()

Given an array of strings, a number and, if wanted, an optional locale (the default one is used otherwise), this picks the right string according to plural rules of the locale

Parameters:
  • array|string
  • int
Throws ExceptionInvalidArgumentException:
 
Return type:

string

Project Versions

Table Of Contents

Previous topic

976. Class

Next topic

978. Class

This Page