public function MultipleAssetLibraryType::getAttachableAssetLibraries in Libraries API 8.3
Reacts to the instantiation of a library.
Parameters
\Drupal\libraries\ExternalLibrary\LibraryInterface $external_library: The library that is being instantiated.
\Drupal\libraries\ExternalLibrary\LibraryManagerInterface $library_manager:
Overrides AttachableAssetLibraryRegistrationInterface::getAttachableAssetLibraries
File
- src/
Plugin/ libraries/ Type/ MultipleAssetLibraryType.php, line 27
Class
- MultipleAssetLibraryType
- Plugin annotation @LibraryType("asset_multiple");
Namespace
Drupal\libraries\Plugin\libraries\TypeCode
public function getAttachableAssetLibraries(LibraryInterface $external_library, LibraryManagerInterface $library_manager) {
assert($external_library instanceof \Drupal\libraries\ExternalLibrary\Asset\MultipleAssetLibraryInterface);
/** @var \Drupal\libraries\ExternalLibrary\Asset\MultipleAssetLibraryInterface $external_library */
$attachable_libraries = [];
foreach ($external_library
->getAttachableAssetLibraries($library_manager) as $component_name => $attachable_library) {
$attachable_library_id = $this
->getAttachableLibraryId($external_library, $component_name);
$attachable_libraries[$attachable_library_id] = $attachable_library;
}
return $attachable_libraries;
}