You are here

interface RemoteLibraryInterface in Libraries API 8.3

Provides an interface for remote libraries.

Assuming they declare a remote URL, remote libraries are always loaded. It is not checked whether or not the Drupal site has network access or the remote resource is available.

Hierarchy

Expanded class hierarchy of RemoteLibraryInterface

All classes that implement RemoteLibraryInterface

2 files declare their use of RemoteLibraryInterface
AssetLibrary.php in src/ExternalLibrary/Asset/AssetLibrary.php
MultipleAssetLibrary.php in src/ExternalLibrary/Asset/MultipleAssetLibrary.php

File

src/ExternalLibrary/Remote/RemoteLibraryInterface.php, line 14

Namespace

Drupal\libraries\ExternalLibrary\Remote
View source
interface RemoteLibraryInterface extends LibraryInterface {

  /**
   * 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\Asset\AssetLibraryInterface
   */
  public function hasRemoteUrl();

  /**
   * Returns the remote URL of the library.
   *
   * @return string
   *   The remote URL of the library.
   *
   * @todo Consider throwing an exception if hasRemoteUrl() return FALSE.
   */
  public function getRemoteUrl();

}

Members

Namesort descending Modifiers Type Description Overrides
LibraryInterface::create public static function Creates an instance of the library from its definition. 1
LibraryInterface::getId public function Returns the ID of the library.
LibraryInterface::getType public function Returns the library type of the library. 1
RemoteLibraryInterface::getRemoteUrl public function Returns the remote URL of the library.
RemoteLibraryInterface::hasRemoteUrl public function Checks whether the library has a remote URL.