CountryManager::getList

public CountryManager::getList()

Get an array of country code => country name pairs, altered by alter hooks.

Return value

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

Overrides CountryManagerInterface::getList

See also

\Drupal\Core\Locale\CountryManager::getStandardList()

File

core/lib/Drupal/Core/Locale/CountryManager.php, line 315

Class

CountryManager
Provides list of countries.

Namespace

Drupal\Core\Locale

Code

1
2
3
4
5
6
7
8
9
public function getList() {
  // Populate the country list if it is not already populated.
  if (!isset($this->countries)) {
    $this->countries = static::getStandardList();
    $this->moduleHandler->alter('countries', $this->countries);
  }
 
  return $this->countries;
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.