You are here

public function LibraryDiscovery::getLibrariesByExtension in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Asset/LibraryDiscovery.php \Drupal\Core\Asset\LibraryDiscovery::getLibrariesByExtension()
  2. 9 core/lib/Drupal/Core/Asset/LibraryDiscovery.php \Drupal\Core\Asset\LibraryDiscovery::getLibrariesByExtension()

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];
}