``country_timezones`` ===================== .. versionadded:: 2.12 The ``country_timezones`` function was added in Twig 2.12. The ``country_timezones`` function returns the names of the timezones associated with a given country code: .. code-block:: twig {# Europe/Paris #} {{ country_timezones('FR')|join(', ') }} .. note:: The ``country_timezones`` function is part of the ``IntlExtension`` which is not installed by default. Install it first: .. code-block:: bash $ composer req twig/intl-extra Then, use the ``twig/extra-bundle`` on Symfony projects or add the extension explictly on the Twig environment:: use Twig\Extra\Intl\IntlExtension; $twig = new \Twig\Environment(...); $twig->addExtension(new IntlExtension());
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
attribute.rst | File | 679 B | 0644 |
|
block.rst | File | 968 B | 0644 |
|
constant.rst | File | 686 B | 0644 |
|
country_timezones.rst | File | 799 B | 0644 |
|
cycle.rst | File | 546 B | 0644 |
|
date.rst | File | 1.3 KB | 0644 |
|
dump.rst | File | 1.63 KB | 0644 |
|
html_classes.rst | File | 899 B | 0644 |
|
include.rst | File | 2.42 KB | 0644 |
|
index.rst | File | 213 B | 0644 |
|
max.rst | File | 403 B | 0644 |
|
min.rst | File | 402 B | 0644 |
|
parent.rst | File | 562 B | 0644 |
|
random.rst | File | 1.2 KB | 0644 |
|
range.rst | File | 1.2 KB | 0644 |
|
source.rst | File | 852 B | 0644 |
|
template_from_string.rst | File | 1.27 KB | 0644 |
|