You are here

protected function DynamicRenderProcessor::getDynamicBlockNames in Gutenberg 8.2

List of dynamic Gutenberg blocks.

Return value

array List of of dynamic block names.

File

src/BlockProcessor/DynamicRenderProcessor.php, line 118

Class

DynamicRenderProcessor
Processes blocks which can be rendered dynamically server-side.

Namespace

Drupal\gutenberg\BlockProcessor

Code

protected function getDynamicBlockNames() {
  if ($this->dynamicBlocks === NULL) {
    $this->dynamicBlocks = [];
    foreach ($this->libraryManager
      ->getDefinitions() as $definition) {
      foreach ($definition['dynamic-blocks'] as $block_name => $block_theme_definition) {
        $this->dynamicBlocks[$block_name] = $block_name;
      }
    }
  }
  return $this->dynamicBlocks;
}