You are here

public function JsDelivr::getAssets in Express 8

Retrieves Provider assets for the active provider, if any.

Parameters

string|array $types: The type of asset to retrieve: "css" or "js", defaults to an array array containing both if not set.

Return value

array If $type is a string or an array with only one (1) item in it, the assets are returned as an indexed array of files. Otherwise, an associative array is returned keyed by the type.

Overrides ProviderBase::getAssets

File

themes/contrib/bootstrap/src/Plugin/Provider/JsDelivr.php, line 88
Contains \Drupal\bootstrap\Plugin\Provider\JsDelivr.

Class

JsDelivr
The "jsdelivr" CDN provider plugin.

Namespace

Drupal\bootstrap\Plugin\Provider

Code

public function getAssets($types = NULL) {
  $this->assets = [];
  $error = !empty($provider['error']);
  $version = $error ? Bootstrap::FRAMEWORK_VERSION : $this->theme
    ->getSetting('cdn_jsdelivr_version');
  $theme = $error ? 'bootstrap' : $this->theme
    ->getSetting('cdn_jsdelivr_theme');
  if (isset($this->pluginDefinition['themes'][$version][$theme])) {
    $this->assets = $this->pluginDefinition['themes'][$version][$theme];
  }
  return parent::getAssets($types);
}