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 preferred 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:
- http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
- https://developer.mozilla.org/en-US/docs/Localization_and_Plurals
Methods
__construct()
__construct()
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
__invoke(array | string $strings, int $number) : string
Parameters
$strings
arraystring
$number
int
Exceptions
Returns
string
Set the View object
setView(\Zend\View\Renderer\RendererInterface $view) : \Zend\View\Helper\AbstractHelper
Inherited
inherited_from |
\Zend\View\Helper\AbstractHelper::setView() |
Parameters
Returns
Properties