function public function ProviderBase::getCdnThemes

8.x-3.x ProviderBase.php public ProviderBase::getCdnThemes($version = NULL)
7.x-3.x ProviderBase.php public ProviderBase::getCdnThemes($version = NULL)

Retrieves the themes supported by the CDN Provider.


string $version: Optional. A specific version of themes to retrieve. If not set, the currently set CDN version of the active theme will be used.

Return value

\Drupal\bootstrap\Plugin\Provider\CdnAssets[] An associative array of CDN assets, similar to what is returned in \Drupal\bootstrap\Plugin\Provider\ProviderBase::getCdnAssets(), but keyed by individual theme names.

Overrides ProviderInterface::getCdnThemes


CDN Provider base class.



Source src/Plugin/Provider/ProviderBase.php (line 357)

public function getCdnThemes($version = NULL) {
  // Immediately return if the CDN Provider does not support themes.
  if (!$this->supportsThemes()) {
    return [];

  $data = $this->getCdnThemesCacheData($version);
  $hash = Crypt::generateBase64HashIdentifier($data);
  if (!isset($this->themes[$hash])) {
    $this->themes[$hash] = $this->cacheGet('themes', $hash, [], function() use ($data) {
      return $this->discoverCdnThemes($data['version']);

  return $this->themes[$hash];