You are here

function country_get_predefined_list in Smart IP 8.2

Same name and namespace in other branches
  1. 8.4 includes/smart_ip.country_list.inc \country_get_predefined_list()
  2. 8.3 includes/smart_ip.country_list.inc \country_get_predefined_list()
  3. 6.2 includes/smart_ip.country_list.inc \country_get_predefined_list()
  4. 6 includes/smart_ip.country_list.inc \country_get_predefined_list()
  5. 7.2 includes/smart_ip.country_list.inc \country_get_predefined_list()

Get an array of all country code => country name pairs.

Get an array of all country code => country name pairs as laid out in ISO 3166-1 alpha-2.

Return value

An array of all country code => country name pairs.

1 call to country_get_predefined_list()
SmartIp::userLocationFallback in src/SmartIp.php
Use server's mod_geoip, X-GeoIP and Cloudflare IP Geolocation as fallback if the user's geolocation is empty

File

includes/smart_ip.country_list.inc, line 16
Provides a list of countries based on ISO standards.

Code

function country_get_predefined_list() {
  $countries = \Drupal\Core\Locale\CountryManager::getStandardList();

  // Allow other modules to modify country list via hook_smart_ip_country_predefined_list_alter()
  \Drupal::moduleHandler()
    ->alter('smart_ip_country_predefined_list', $countries);
  return $countries;
}