function CKEditor5PluginDefinition::getLibrary

Same name in other branches
  1. 9 core/modules/ckeditor5/src/Plugin/CKEditor5PluginDefinition.php \Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition::getLibrary()
  2. 10 core/modules/ckeditor5/src/Plugin/CKEditor5PluginDefinition.php \Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition::getLibrary()

Gets the asset library this plugin needs to be loaded.

Return value

string An asset library ID.

Throws

\LogicException When called on a plugin definition that has no library.

See also

\Drupal\ckeditor5\Annotation\DrupalAspectsOfCKEditor5Plugin::$library

File

core/modules/ckeditor5/src/Plugin/CKEditor5PluginDefinition.php, line 424

Class

CKEditor5PluginDefinition
Provides an implementation of a CKEditor 5 plugin definition.

Namespace

Drupal\ckeditor5\Plugin

Code

public function getLibrary() : string {
    if (!$this->hasLibrary()) {
        throw new \LogicException('::getLibrary() should only be called if ::hasLibrary() returns TRUE.');
    }
    return $this->drupal['library'];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.