davedevelopment / twig-inflection
Twig filters for inflection
Installs: 24 238
Dependents: 2
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 4
Open Issues: 0
Requires
- php: >=5.3.2
- doctrine/inflector: ~1.0
- twig/twig: ~1.12
Requires (Dev)
- phpunit/phpunit: ~3.7
This package is auto-updated.
Last update: 2024-12-16 20:01:47 UTC
README
pluralize
{{ "chicken"|pluralize }} => chickens {{ rows.length }} {{ "row"|pluralize(rows.length) }} => 1 row => 2 rows {{ users.length }} {{ "person"|pluralize(users.length, "users") }} => 1 person => 2 users
singularize
The opposite of pluralize, working in the same manner
{{ "chickens"|singularize }} => chicken
Contributing
Get in touch before hacking on anything, I've no idea what I might be doing, the whole library may have changed since my last push :)
Copyright
Copyright (c) 2013 Dave Marshall. See LICENCE for further details