Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update intl.rst #12170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update intl.rst
  • Loading branch information
ro0NL authored Aug 15, 2019
commit d757a2dc91d21b8606ac4d552711e259057db45e
8 changes: 5 additions & 3 deletions 8 components/intl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,10 @@ of officially recognized countries and territories::

\Locale::setDefault('en');

// Indexed with alpha-2
$countries = Countries::getNames();
// ('alpha2Code' => 'countryName')
// => ['AF' => 'Afghanistan', 'AX' => 'Åland Islands', ...]

// Indexed with alhpa-3
$countries = Countries::getAlpha3Names();
// ('alpha3Code' => 'countryName')
// => ['AFG' => 'Afghanistan', 'ALA' => 'Åland Islands', ...]
Expand All @@ -188,6 +186,10 @@ of officially recognized countries and territories::
$country = Countries::getAlpha3Name('NOR');
// => 'Norway'

.. versionadded:: 4.4

The support for alpha3 codes was introduced in Symfony 4.4.

All methods accept the translation locale as the last, optional parameter,
which defaults to the current default locale::

Expand All @@ -209,7 +211,7 @@ to catching the exception, you can also check if a given country code is valid::

$isValidCountry = Countries::exists($alpha2Code);

Or if you have a alpha3 country code you want to check:
Or if you have a alpha3 country code you want to check::

$isValidCountry = Countries::alpha3CodeExists($alpha3Code);

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.