davedevelopment/twig-inflection

Twig单词变形过滤器

1.0 2013-02-19 00:24 UTC

This package is auto-updated.

Last update: 2024-09-16 19:31:23 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

pluralize的反义词,以相同的方式工作

{{ "chickens"|singularize }}

=> chicken

贡献

在开始任何修改之前,请与我联系,我可能不知道我在做什么,整个库可能从我上次提交后已经发生了变化 :)

版权

版权 (c) 2013 Dave Marshall。有关更多信息,请参阅LICENCE。