DummyImageFormatter.php

Same filename in other branches
  1. 9 core/modules/image/tests/modules/image_module_test/src/Plugin/Field/FieldFormatter/DummyImageFormatter.php
  2. 8.9.x core/modules/image/tests/modules/image_module_test/src/Plugin/Field/FieldFormatter/DummyImageFormatter.php
  3. 11.x core/modules/image/tests/modules/image_module_test/src/Plugin/Field/FieldFormatter/DummyImageFormatter.php

Namespace

Drupal\image_module_test\Plugin\Field\FieldFormatter

File

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

View source
<?php

namespace Drupal\image_module_test\Plugin\Field\FieldFormatter;

use Drupal\Core\Field\Attribute\FieldFormatter;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FormatterBase;
use Drupal\Core\StringTranslation\TranslatableMarkup;

/**
 * Plugin implementation of the Dummy image formatter.
 */
class DummyImageFormatter extends FormatterBase {
    
    /**
     * {@inheritdoc}
     */
    public function viewElements(FieldItemListInterface $items, $langcode) {
        return [
            [
                '#markup' => 'Dummy',
            ],
        ];
    }

}

Classes

Title Deprecated Summary
DummyImageFormatter Plugin implementation of the Dummy image formatter.

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