function CKEditor5PluginDefinition::getElements

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

Gets the list of elements and attributes this plugin allows to create/edit.

Return value

string[] A list of elements and attributes.

Throws

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

See also

\Drupal\ckeditor5\Annotation\DrupalAspectsOfCKEditor5Plugin::$elements

1 call to CKEditor5PluginDefinition::getElements()
CKEditor5PluginDefinition::getCreatableElements in core/modules/ckeditor5/src/Plugin/CKEditor5PluginDefinition.php
Gets the elements this plugin allows to create.

File

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

Class

CKEditor5PluginDefinition
Provides an implementation of a CKEditor 5 plugin definition.

Namespace

Drupal\ckeditor5\Plugin

Code

public function getElements() : array {
    if (!$this->hasElements()) {
        throw new \LogicException('::getElements() should only be called if ::hasElements() returns TRUE.');
    }
    return $this->drupal['elements'];
}

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