You are here

public function CKEditor5PluginDefinition::getLibrary in Drupal 10

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 397

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'];
}