PHPackages                             tomodomo/twig-pluralize-extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. tomodomo/twig-pluralize-extension

ActiveLibrary[Templating &amp; Views](/categories/templating)

tomodomo/twig-pluralize-extension
=================================

Twig extension to output correctly pluralized strings

v2.0.0(7y ago)831.8k4[1 issues](https://github.com/TomodomoCo/twig-pluralize-extension/issues)BSD-3-ClausePHPPHP &gt;=5.4.0

Since Aug 3Pushed 5y ago2 watchersCompare

[ Source](https://github.com/TomodomoCo/twig-pluralize-extension)[ Packagist](https://packagist.org/packages/tomodomo/twig-pluralize-extension)[ Docs](https://tomodomo.co/)[ RSS](/packages/tomodomo-twig-pluralize-extension/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (5)Used By (0)

Twig Pluralize
==============

[](#twig-pluralize)

A simple extension for Twig that allows you to pluralize a given string.

Usage
-----

[](#usage)

Register the function, then reference it in your template:

```
This section has {{pluralize(categories|length, 'one category', '%d categories', 'no categories')}}.
```

Given the values 0, 1, and 5, the above would output:

```
0: This section has no categories.
1: This section has one category.
5: This section has 5 categories.
```

The last parameter (the "zero items" string) is optional. If omitted, the 3rd parameter (the "many items" string) will be used, as in the following:

```
This section has {{pluralize(categories|length, 'one category', '%d categories')}}.
```

```
0: This section has 0 categories.
1: This section has one category.
5: This section has 5 categories.
```

The strings are passed through sprintf. You can use the %d token to insert the count into your string, if desired.

About Tomodomo
--------------

[](#about-tomodomo)

Tomodomo is a creative agency for magazine publishers. We use custom design and technology to speed up your editorial workflow, engage your readers, and build sustainable subscription revenue for your business.

Learn more at [tomodomo.co](https://tomodomo.co) or email us:

License &amp; Conduct
---------------------

[](#license--conduct)

This project is licensed under the terms of the MIT License, included in `LICENSE.md`.

All open source Tomodomo projects follow a strict code of conduct, included in `CODEOFCONDUCT.md`. We ask that all contributors adhere to the standards and guidelines in that document.

Thank you!

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~278 days

Total

4

Last Release

2734d ago

Major Versions

v1.0.2 → v2.0.02018-11-16

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24738488?v=4)[tomodomo](/maintainers/tomodomo)[@tomodomo](https://github.com/tomodomo)

---

Top Contributors

[![chrisvanpatten](https://avatars.githubusercontent.com/u/1231306?v=4)](https://github.com/chrisvanpatten "chrisvanpatten (7 commits)")

---

Tags

pluraltwigtwig-extension

### Embed Badge

![Health badge](/badges/tomodomo-twig-pluralize-extension/health.svg)

```
[![Health](https://phpackages.com/badges/tomodomo-twig-pluralize-extension/health.svg)](https://phpackages.com/packages/tomodomo-twig-pluralize-extension)
```

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91292.0M315](/packages/twig-extra-bundle)[twig/intl-extra

A Twig extension for Intl

36663.2M221](/packages/twig-intl-extra)[twig/string-extra

A Twig extension for Symfony String

21946.0M133](/packages/twig-string-extra)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

23018.5M55](/packages/twig-cssinliner-extra)[symfony/ux-twig-component

Twig components for Symfony

21814.8M162](/packages/symfony-ux-twig-component)[bluetel-solutions/twig-truncate-extension

Twig Extension to truncate nested HTML, safely!

11100.0k](/packages/bluetel-solutions-twig-truncate-extension)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
