function public function Theme::getCdnProviders

8.x-3.x Theme.php public Theme::getCdnProviders()

Retrieves all available CDN Provider instances.

Return value

\Drupal\bootstrap\Plugin\Provider\ProviderInterface[] All CDN Provider instances.

Class

Theme
Defines a theme object.

Namespace

Drupal\bootstrap

Source src/Theme.php (line 434)

public function getCdnProviders() {
  if (!isset($this->cdnProviders)) {
    $this->cdnProviders = [];

    // Only continue if the theme is Bootstrap based.
    if ($this->isBootstrap()) {
      $provider_manager = new ProviderManager($this);
      foreach ($provider_manager->getDefinitions() as $provider => $definition) {
        // Ignore hidden providers.
        if (!empty($definition['hidden'])) {
          continue;
        }
        $this->cdnProviders[$provider] = $provider_manager->get($provider, ['theme' => $this]);
      }
    }
  }
  return $this->cdnProviders;
}