public function MultipleAssetLibrary::getLocator in Libraries API 8.3
Gets the locator of this library using the locator factory.
Parameters
\Drupal\Component\Plugin\Factory\FactoryInterface $locator_factory:
Return value
\Drupal\libraries\ExternalLibrary\Local\LocatorInterface
Overrides LocalLibraryInterface::getLocator
See also
\Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface::getLocator()
File
- src/
ExternalLibrary/ Asset/ MultipleAssetLibrary.php, line 115
Class
- MultipleAssetLibrary
- Provides a class for a library with multiple attachable asset libraries.
Namespace
Drupal\libraries\ExternalLibrary\AssetCode
public function getLocator(FactoryInterface $locator_factory) {
// @todo Consider consolidating the stream wrappers used here. For now we
// allow asset libs to live almost anywhere.
return $locator_factory
->createInstance('chain')
->addLocator($locator_factory
->createInstance('uri', [
'uri' => 'asset://',
]))
->addLocator($locator_factory
->createInstance('uri', [
'uri' => 'php-file://',
]));
}