Skip to content Skip to footer navigation
You are reading the docs for an old version of Statamic. Consider upgrading to Statamic 6.

Plural Modifier

Get the plural form of an English word. Accepts a numerical parameter, either as a literal value or a variable, to control plurality. It's important to note that you should use the singular form of the word to ensure the best results.

shopping_list:
- item: pickle
quantity: 1
- item: apple
quantity: 12
- item: donut
quantity: 500
Please pick up the following items:
{{ shopping_list }}
- {{ quantity }} {{ item | plural($quantity) }}.
{{ /shopping_list }}
@foreach ($shopping_list as $item)
- {{ $item['quantity'] }} {{ Statamic::modify($item)->plural($item['quantity']) }}
@endforeach
Please pick up the following items:
- 1 pickle
- 3 apples
- 500 donuts