You are here

public function FormatterPlugin::getFormatter in Blazy 7

Return the cached formatter based on the field type.

File

src/Plugin/Field/FieldFormatter/FormatterPlugin.php, line 62

Class

FormatterPlugin
Blazy formatter plugin initializer.

Namespace

Drupal\blazy\Plugin\Field\FieldFormatter

Code

public function getFormatter($type, $field, $instance, $namespace = 'blazy') {
  if (!isset($this->formatterType[$type])) {
    $this->formatterType[$type] = $this
      ->getActiveFormatter($type, $field, $instance, $namespace);
  }
  return $this->formatterType[$type];
}