function country_get_predefined_list in Smart IP 8.3
Same name and namespace in other branches
- 8.4 includes/smart_ip.country_list.inc \country_get_predefined_list()
- 8.2 includes/smart_ip.country_list.inc \country_get_predefined_list()
- 6.2 includes/smart_ip.country_list.inc \country_get_predefined_list()
- 6 includes/smart_ip.country_list.inc \country_get_predefined_list()
- 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.
3 calls 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.
- UserCountry::buildConfigurationForm in src/
Plugin/ Condition/ UserCountry.php - Form constructor.
- UserCountry::summary in src/
Plugin/ Condition/ UserCountry.php - Provides a human readable summary of the condition's configuration.
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;
}