Download the PHP package wapmorgan/morphos-twig without Composer
On this page you can find all versions of the php package wapmorgan/morphos-twig. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wapmorgan/morphos-twig
More information about wapmorgan/morphos-twig
Files in wapmorgan/morphos-twig
Package morphos-twig
Short Description Adds a {{ plural }}, {{ name }}, {{ numeral }}, {{ ordinal }} and {{ money }} filters to Twig templating engine for Russian pluralization and declenation.
License MIT
Informations about the package morphos-twig
MorphosTwig
Adds {{ plural }}, {{ name }}, {{ numeral }}, {{ ordinal }} and {{ money }} filters to Twig templating engine for Russian pluralization and declenation.
Will be compiled in
Most popular filters:
-
{{ $word|plural($count) }}
- Get plural form of word. Just pass count of objects and noun. -
{{ $value|money($currency) }}
- Get money formatted as text string. Just pass value and currency (₽ or $ or € or ₴ or £). -
{{ $number|numeral }}
- Get cardinal of a number. Just pass number. -
{{ $number|ordinal }}
- Get ordinal of a number. Just pass number. {{ $name|name($case) }}
- Get any case of fullname with gender detection.
Additional filters:
-
{{ $name|name($gender, $case) }}
- Get any case of fullname. Just pass name, gender (m
orf
or null) and case (именительный, родительный, дательный, винительный, творительный, предложный). -
{{ $number|numeral($gender) }}
- Get numeral of a number. Just pass number and gender (m
orf
orn
) to use correct form of gender-dependent words (один/одно/одна, два/две). -
{{ $word|numeral($number) }}
- Get numeral with a pluralized word. Just pass number and noun. -
{{ $word|numeral($number, $gender) }}
- Get numeral with a pluralized word. Just pass number, noun and gender (m
orf
orn
) to use correct form of gender-dependent words (один/одно/одна, два/две). {{ $number|ordinal($gender) }}
- Get ordinal of a number. Just pass number and gender (m
orf
orn
) to use correct form of gender-dependent words (первый/первое/первая, второй/второе/вторая, etc).
Installation
Get the Package
Register the Service
Open up your services.php
in your app/config
folder, and add the following lines:
or if you using Twig separately from Symfony