function LibraryDiscovery::getLibrariesByExtension

Same name in other branches
  1. 9 core/lib/Drupal/Core/Asset/LibraryDiscovery.php \Drupal\Core\Asset\LibraryDiscovery::getLibrariesByExtension()
  2. 10 core/lib/Drupal/Core/Asset/LibraryDiscovery.php \Drupal\Core\Asset\LibraryDiscovery::getLibrariesByExtension()
  3. 11.x core/lib/Drupal/Core/Asset/LibraryDiscovery.php \Drupal\Core\Asset\LibraryDiscovery::getLibrariesByExtension()

Overrides LibraryDiscoveryInterface::getLibrariesByExtension

1 call to LibraryDiscovery::getLibrariesByExtension()
LibraryDiscovery::getLibraryByName in core/lib/Drupal/Core/Asset/LibraryDiscovery.php
Gets a single library defined by an extension by name.

File

core/lib/Drupal/Core/Asset/LibraryDiscovery.php, line 42

Class

LibraryDiscovery
Discovers available asset libraries in Drupal.

Namespace

Drupal\Core\Asset

Code

public function getLibrariesByExtension($extension) {
    if (!isset($this->libraryDefinitions[$extension])) {
        $libraries = $this->collector
            ->get($extension);
        $this->libraryDefinitions[$extension] = [];
        foreach ($libraries as $name => $definition) {
            $this->libraryDefinitions[$extension][$name] = $definition;
        }
    }
    return $this->libraryDefinitions[$extension];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.