mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-17 21:07:18 +00:00
4d62307f9899420a2027d2b963f5c9b2b5b06fbd
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.
Discussion
----------
IntlExtension > Return empty string when input is null
```twig
{{ inputCountry | country_name('en') }}
```
When `inputCountry` is `null` it will give this error:
```
Argument 1 passed to Twig\Extra\Intl\IntlExtension::getCountryName() must be of the type string, null given
```
With this change, an empty string will be returned instead.
See discussion in https://github.com/twigphp/Twig/pull/3257#issuecomment-585740408
Commits
-------
caecd2a5 IntlExtension > Return empty string when input is null
…
Twig, the flexible, fast, and secure template language for PHP
==============================================================
Twig is a template language for PHP, released under the new BSD license (code
and documentation).
Twig uses a syntax similar to the Django and Jinja template languages which
inspired the Twig runtime environment.
Sponsors
--------
.. raw:: html
<a href="https://blackfire.io/docs/introduction?utm_source=twig&utm_medium=github_readme&utm_campaign=logo">
<img src="https://static.blackfire.io/assets/intemporals/logo/png/blackfire-io_secondary_horizontal_transparent.png?1" width="255px" alt="Blackfire.io">
</a>
More Information
----------------
Read the `documentation`_ for more information.
.. _documentation: https://twig.symfony.com/documentation
Description
Languages
PHP
99.9%