blob: ecbbc1c994156131d9f2703844f9126bc819c6ce [file] [log] [blame]
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +01001``country_timezones``
2=====================
3
4The ``country_timezones`` function returns the names of the timezones associated
5with a given country code:
6
7.. code-block:: twig
8
9 {# Europe/Paris #}
10 {{ country_timezones('FR')|join(', ') }}
11
12.. note::
13
14 The ``country_timezones`` function is part of the ``IntlExtension`` which is not
15 installed by default. Install it first:
16
17 .. code-block:: bash
18
19 $ composer require twig/intl-extra
20
21 Then, on Symfony projects, install the ``twig/extra-bundle``:
22
23 .. code-block:: bash
24
25 $ composer require twig/extra-bundle
26
27 Otherwise, add the extension explicitly on the Twig environment::
28
29 use Twig\Extra\Intl\IntlExtension;
30
31 $twig = new \Twig\Environment(...);
32 $twig->addExtension(new IntlExtension());