twig_extensions
388 sites
Security covered
This module provides common additional features for Twig that do not directly belong in core. It used to include these through the twig/extensions package, but since that has been abandoned the extensions have been included in the module itself.
Filters
Extension name Descriptionshuffle
Shuffles an array.
time_diff
Converts dates to a time ago string like Facebook and Twitter has.
localizeddate
Formats dates using \IntlDateFormatter.
localizednumber
Formats numbers using \IntlDateFormatter.
localizedcurrency
Formats currencies using \IntlDateFormatter.
truncate
Truncates text to a certain length, optionally preserving words.
wordwrap
Wraps a string into new lines when it reaches a specific length.
Similar projects
- Twig IntlExtension: provides alternatives to the
localized*filters. Uses the twigphp/intl-extra package, but breaks the coreformat_datefilter - Time diff: provides a
time_difffilter, but isn't as flexible as the original Twig filter