trait RemoteLibraryTrait in Libraries API 8.3
Provides a trait for remote libraries.
Hierarchy
- trait \Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryTrait
2 files declare their use of RemoteLibraryTrait
- AssetLibrary.php in src/
ExternalLibrary/ Asset/ AssetLibrary.php - MultipleAssetLibrary.php in src/
ExternalLibrary/ Asset/ MultipleAssetLibrary.php
File
- src/
ExternalLibrary/ Remote/ RemoteLibraryTrait.php, line 8
Namespace
Drupal\libraries\ExternalLibrary\RemoteView source
trait RemoteLibraryTrait {
/**
* The remote library URL.
*
* @var string
*/
protected $remoteUrl;
/**
* Checks whether the library has a remote URL.
*
* This check allows using the same library class for multiple libraries only
* some of which are available remotely.
*
* @return bool
* TRUE if the library has a remote URL; FALSE otherwise.
*
* @see \Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryInterface::hasRemoteUrl()
*/
public function hasRemoteUrl() {
return !empty($this->remoteUrl);
}
/**
* Returns the remote URL of the library.
*
* @return string
* The remote URL of the library.
*
* \Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryInterface::getRemoteUrl()
*/
public function getRemoteUrl() {
return $this->remoteUrl;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RemoteLibraryTrait:: |
protected | property | The remote library URL. | |
RemoteLibraryTrait:: |
public | function | Returns the remote URL of the library. | |
RemoteLibraryTrait:: |
public | function | Checks whether the library has a remote URL. |