twig/extensions
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
twig/twig | v2.16.0 | 275.82 kB | BSD-3-Clause | prod |
The Twig/Extensions package is a collection of common additional features for Twig, a template engine for PHP. This package includes features that are not directly related to the core functions of Twig but can still be beneficial for developers. It includes ArrayExtension, DateExtension, I18nExtension, IntlExtension, and TextExtension among others. However, it's important to note that this repository has been abandoned in favor of Twig Core Extra extensions.
To use the Twig/Extensions, you first need to install it. Since it is a Composer package, you can simply run composer require twig/extensions
in your project directory. Once installed, you can use the provided extensions in your Twig templates. For instance, using the localizeddate
filter from IntlExtension would be as follows:
{{ post.date|localizeddate('medium', 'none', 'fr_FR') }}
In this example, post.date
is a DateTime object, 'medium'
is the date format, 'none'
means no time will be displayed, and 'fr_FR'
is the locale.
The documentation for Twig/Extensions can be found at http://twig-extensions.readthedocs.io/. There you'll find detailed information about the usage and possibilities of this package. Please remember that since this repository is abandoned, it's recommended to transition to the suggested alternatives as specified in the repository.