Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 27, 2024 via composer

twig/intl-extra v3.8.0

A Twig extension for Intl
Package summary
Share
0
issues
2
licenses
6
MIT
1
BSD-3-Clause
Package created
10 Aug 2019
Version published
21 Nov 2023
Maintainers
1
Total deps
7
Direct deps
2
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
6 Packages, Including:
symfony/deprecation-contracts@v3.5.0
symfony/intl@v7.0.7
symfony/polyfill-ctype@v1.29.0
symfony/polyfill-mbstring@v1.29.0
symfony/polyfill-php80@v1.29.0
twig/intl-extra@v3.8.0

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
twig/twig@v3.10.3
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of twig/intl-extra 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
symfony/intlv7.0.7-MIT
prod
twig/twigv3.10.3-BSD-3-Clause
prod

Visualizations

Frequently Asked Questions

What does twig/intl-extra do?

The twig/intl-extra is a valuable composer package that acts as an extension for Twig, primarily aimed at handling internationalization elements within your project. This includes formatting for numbers, dates, times, and currencies, including localization for specific country and language names. It also has the ability to handle country-specific timezone identifiers and offer detailed information about currency, including the name and symbol.

How do you use twig/intl-extra?

Using twig/intl-extra in your PHP project is accomplished like any other Twig extension.

To begin with, you need to install the package via Composer using the command:

composer require twig/intl-extra

Next, enable the extension in your Twig environment. An example implementation could be:

$twig = new \Twig\Environment($loader);
$twig->addExtension(new Twig\Extra\Intl\IntlExtension());

This gives you access to several Twig filters that you can incorporate into your templates. For instance, if you want to format a number as a currency or get a country name from a given code, you can do:

{{ 'US'|country_name }}
{{ 1000000|format_currency('USD', 'en_US') }}

In the first line, 'US' is the two-letter code for the United States, while in the second line, '1000000' is the number to be formatted, 'USD' is the currency code, and 'en_US' is the locale.

Where are the twig/intl-extra docs?

Detailed documentation for the twig/intl-extra package is available directly through the Twig Symfony website. The site features a comprehensive breakdown for each filter provided by the package, including country_name, currency_name, currency_symbol, language_name, locale_name, timezone_name, country_timezones, format_currency, format_number, format_datetime, format_date, and format_time. The respecive links for documentation of these filters are provided in the readme file, each filter's description can be accessed using its specific link. For example, to learn more about the country_name filter, you can visit twig.symfony.com/country_name.