class DummyImageFormatter

Same name and namespace in other branches
  1. 11.x core/modules/image/tests/modules/image_module_test/src/Plugin/Field/FieldFormatter/DummyImageFormatter.php \Drupal\image_module_test\Plugin\Field\FieldFormatter\DummyImageFormatter

Plugin implementation of the Dummy image formatter.

Plugin annotation


@FieldFormatter(
  id = "dummy_image_formatter",
  label = @Translation("Dummy image"),
  field_types = {
    "image"
  }
)

Hierarchy

Expanded class hierarchy of DummyImageFormatter

File

core/modules/image/tests/modules/image_module_test/src/Plugin/Field/FieldFormatter/DummyImageFormatter.php, line 19

Namespace

Drupal\image_module_test\Plugin\Field\FieldFormatter
View source
class DummyImageFormatter extends FormatterBase {
  
  /**
   * {@inheritdoc}
   */
  public function viewElements(FieldItemListInterface $items, $langcode) {
    return [
      [
        '#markup' => 'Dummy',
      ],
    ];
  }

}

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