public function LibraryManager::getLibrary in Libraries API 8.3
Gets a library by its ID.
Parameters
string $id: The library ID.
Return value
\Drupal\libraries\ExternalLibrary\LibraryInterface The library object.
Throws
\Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException
\Drupal\libraries\ExternalLibrary\Exception\LibraryTypeNotFoundException
\Drupal\Component\Plugin\Exception\PluginException
Overrides LibraryManagerInterface::getLibrary
File
- src/
ExternalLibrary/ LibraryManager.php, line 53
Class
- LibraryManager
- Provides a manager for external libraries.
Namespace
Drupal\libraries\ExternalLibraryCode
public function getLibrary($id) {
$definition = $this->definitionDiscovery
->getDefinition($id);
return $this
->getLibraryFromDefinition($id, $definition);
}