You are here

public static function LibrariesCDN::getAvailableCDN in Libraries CDN API 7

Same name and namespace in other branches
  1. 8 src/LibrariesCdn.php \Drupal\libraries_cdn\LibrariesCdn::getAvailableCdn()

Gets a list of available CDN plugins.

Return value

array List of CDN plugins available.

6 calls to LibrariesCDN::getAvailableCDN()
LibrariesCDN::find in src/LibrariesCDN.php
Return CDN Plugin id's of the CDN who provides a library.
LibrariesCDN::isAvailableCDN in src/LibrariesCDN.php
Check if a CDN plugin is available.
LibrariesCDN::search in src/LibrariesCDN.php
Return CDN Plugin id's of the CDN who provides a library.
libraries_cdn_add in ./libraries_cdn.module
Function to add a library to a page.
libraries_cdn_cron in ./libraries_cdn.module
Implements hook_cron().

... See full list

File

src/LibrariesCDN.php, line 37
Contains LibrariesCDN.

Class

LibrariesCDN
Class LibrariesCDN.

Namespace

Drupal\libraries_cdn

Code

public static function getAvailableCDN() {
  $options = array();
  $service_basename = 'libraries_cdn.LibrariesCDN';
  foreach (\Drupal::service($service_basename)
    ->getDefinitions() as $service => $data) {
    $name = isset($data['label']) ? $data['label'] : $data['id'];
    $options[$data['id']] = $name;
  }
  asort($options);
  return $options;
}