You are here

protected function ComponentBlock::formatterPluginManager in Component blocks 1.1.x

Same name and namespace in other branches
  1. 1.x src/Plugin/Block/ComponentBlock.php \Drupal\component_blocks\Plugin\Block\ComponentBlock::formatterPluginManager()
  2. 1.0.x src/Plugin/Block/ComponentBlock.php \Drupal\component_blocks\Plugin\Block\ComponentBlock::formatterPluginManager()

Gets the formatter plugin manager.

In some AJAX contexts, the constructor is not called.

Return value

\Drupal\Core\Field\FormatterPluginManager Manager.

File

src/Plugin/Block/ComponentBlock.php, line 491

Class

ComponentBlock
Defines a class for a specially shaped block.

Namespace

Drupal\component_blocks\Plugin\Block

Code

protected function formatterPluginManager() : FormatterPluginManager {
  if (!$this->formatterPluginManager) {
    $this->formatterPluginManager = \Drupal::service('plugin.manager.field.formatter');
  }
  return $this->formatterPluginManager;
}