function bootstrap_get_cdn_assets

8 deprecated.php bootstrap_get_cdn_assets($type = NULL, $provider = NULL, $theme = NULL)
7 bootstrap_get_cdn_assets($type = NULL, $provider = NULL, $theme = NULL)

Retrieves CDN assets for the active provider, if any.

  // Before.
  $assets = bootstrap_get_cdn_assets($type, $provider, $theme);

  // After.
  use Drupal\bootstrap\Bootstrap;
  $theme = Bootstrap::getTheme($theme);
  $assets = [];
  if ($provider = $theme->getProvider($provider)) {
    $assets = $provider->getAssets($type);


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

string $provider: The name of a specific CDN provider to use, defaults to the active provider set in the theme settings.

string $theme: The name of a specific theme the settings should be retrieved from, defaults to the active theme.

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.


Will be removed in a future release.

Source ./deprecated.php (line 707)

function bootstrap_get_cdn_assets($type = NULL, $provider = NULL, $theme = NULL) {
  $assets = [];
  if ($provider = Bootstrap::getTheme($theme)->getProvider($provider)) {
    $assets = $provider->getAssets($type);
  return $assets;