LibraryDiscovery::getLibrariesByExtension

public LibraryDiscovery::getLibrariesByExtension($extension)

Gets all libraries defined by an extension.

Parameters

string $extension: The name of the extension that registered a library.

Return value

array An associative array of libraries registered by $extension is returned (which may be empty).

Overrides LibraryDiscoveryInterface::getLibrariesByExtension

See also

self::getLibraryByName()

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];
}
doc_Drupal
2016-10-29 09:23:06
Comments
Leave a Comment

Please login to continue.