DummyImageFormatter.php in Drupal 8
Same filename and directory in other branches
File
core/modules/image/tests/modules/image_module_test/src/Plugin/Field/FieldFormatter/DummyImageFormatter.phpView source
<?php
namespace Drupal\image_module_test\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FormatterBase;
/**
* Plugin implementation of the Dummy image formatter.
*
* @FieldFormatter(
* id = "dummy_image_formatter",
* label = @Translation("Dummy image"),
* field_types = {
* "image"
* },
* quickedit = {
* "editor" = "image"
* }
* )
*/
class DummyImageFormatter extends FormatterBase {
/**
* {@inheritdoc}
*/
public function viewElements(FieldItemListInterface $items, $langcode) {
return [
[
'#markup' => 'Dummy',
],
];
}
}
Classes
Name | Description |
---|---|
DummyImageFormatter | Plugin implementation of the Dummy image formatter. |