RegionBundle

class RegionBundle extends RegionDataProvider implements RegionBundleInterface

Default implementation of {@link RegionBundleInterface}.

Methods

__construct(string $path, BundleEntryReaderInterface $reader, LocaleDataProvider $localeProvider)

Creates a data provider that reads locale-related data from .res files.

getRegions() from RegionDataProvider
getName($region, $displayLocale = null) from RegionDataProvider
getNames($displayLocale = null) from RegionDataProvider
string|null getCountryName(string $country, string $displayLocale = null)

Returns the name of a country.

string[] getCountryNames(string $displayLocale = null)

Returns the names of all known countries.

string[] getLocales()

Returns the list of locales that this bundle supports.

Details

__construct(string $path, BundleEntryReaderInterface $reader, LocaleDataProvider $localeProvider)

Creates a data provider that reads locale-related data from .res files.

Parameters

string $path The path to the directory containing the .res files
BundleEntryReaderInterface $reader The reader for reading the .res files
LocaleDataProvider $localeProvider

getRegions()

getName($region, $displayLocale = null)

Parameters

$region
$displayLocale

getNames($displayLocale = null)

Parameters

$displayLocale

string|null getCountryName(string $country, string $displayLocale = null)

Returns the name of a country.

Parameters

string $country A country code (e.g. "US")
string $displayLocale Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}.

Return Value

string|null The name of the country or NULL if not found

string[] getCountryNames(string $displayLocale = null)

Returns the names of all known countries.

Parameters

string $displayLocale Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}.

Return Value

string[] A list of country names indexed by country codes

string[] getLocales()

Returns the list of locales that this bundle supports.

Return Value

string[] A list of locale codes

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Intl/ResourceBundle/RegionBundle.html