You are here

public static function MobileNumberItem::countryOptions in Mobile Number 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Field/FieldType/MobileNumberItem.php \Drupal\mobile_number\Plugin\Field\FieldType\MobileNumberItem::countryOptions()

Get all country options.

Return value

array Array of countries, with country codes as keys and country names with prefix as labels.

File

src/Plugin/Field/FieldType/MobileNumberItem.php, line 541

Class

MobileNumberItem
Plugin implementation of the 'mobile_number' field type.

Namespace

Drupal\mobile_number\Plugin\Field\FieldType

Code

public static function countryOptions() {

  /** @var \Drupal\mobile_number\MobileNumberUtilInterface $util */
  $util = \Drupal::service('mobile_number.util');
  return $util
    ->getCountryOptions([], TRUE);
}