You are here

public function MobileNumberUtil::getCountryName in Mobile Number 8

Same name and namespace in other branches
  1. 2.0.x src/MobileNumberUtil.php \Drupal\mobile_number\MobileNumberUtil::getCountryName()

Get country display name given country code.

Parameters

string $country: Country code.

Return value

string Country name.

Overrides MobileNumberUtilInterface::getCountryName

1 call to MobileNumberUtil::getCountryName()
MobileNumberUtil::getCountryOptions in src/MobileNumberUtil.php
Get all supported countries.

File

src/MobileNumberUtil.php, line 216

Class

MobileNumberUtil
Turns a render array into a HTML string.

Namespace

Drupal\mobile_number

Code

public function getCountryName($country) {
  $drupal_countries = $this->countryManager
    ->getList();
  return !empty($drupal_countries[$country]) ? $drupal_countries[$country] : $country;
}