You are here

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

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

Set the CDN plugin to use.

Parameters

string $plugin: The Plugin ID to use.

string $library: The library to work with.

9 calls to LibrariesCDN::setPlugin()
LibrariesCDN::find in src/LibrariesCDN.php
Return CDN Plugin id's of the CDN who provides a library.
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().
libraries_cdn_libraries_info_alter in ./libraries_cdn.module
Implements hook_libraries_info_alter().

... See full list

File

src/LibrariesCDN.php, line 97
Contains LibrariesCDN.

Class

LibrariesCDN
Class LibrariesCDN.

Namespace

Drupal\libraries_cdn

Code

public static function setPlugin($plugin, $library = NULL, $configuration = array()) {

  /* @var CDNBaseInterface $plugin */
  $plugin = self::service('libraries_cdn.LibrariesCDN')
    ->createInstance($plugin, $configuration);
  if ($library) {
    $plugin
      ->setLibrary($library);
  }
  self::$plugin = $plugin;
}