class TestFieldNoSettingsFormatter
Same name and namespace in other branches
- 11.x core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldNoSettingsFormatter.php \Drupal\field_test\Plugin\Field\FieldFormatter\TestFieldNoSettingsFormatter
- 10 core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldNoSettingsFormatter.php \Drupal\field_test\Plugin\Field\FieldFormatter\TestFieldNoSettingsFormatter
- 8.9.x core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldNoSettingsFormatter.php \Drupal\field_test\Plugin\Field\FieldFormatter\TestFieldNoSettingsFormatter
Plugin implementation of the 'field_no_settings' formatter.
Plugin annotation
@FieldFormatter(
id = "field_no_settings",
label = @Translation("Field no settings"),
field_types = {
"test_field",
},
weight = -10
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
- class \Drupal\Core\Field\PluginSettingsBase implements \Drupal\Core\Field\PluginSettingsInterface, \Drupal\Component\Plugin\DependentPluginInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Field\FormatterBase implements \Drupal\Core\Field\FormatterInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface extends \Drupal\Core\Field\PluginSettingsBase
- class \Drupal\field_test\Plugin\Field\FieldFormatter\TestFieldNoSettingsFormatter extends \Drupal\Core\Field\FormatterBase
- class \Drupal\Core\Field\FormatterBase implements \Drupal\Core\Field\FormatterInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface extends \Drupal\Core\Field\PluginSettingsBase
- class \Drupal\Core\Field\PluginSettingsBase implements \Drupal\Core\Field\PluginSettingsInterface, \Drupal\Component\Plugin\DependentPluginInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of TestFieldNoSettingsFormatter
File
-
core/
modules/ field/ tests/ modules/ field_test/ src/ Plugin/ Field/ FieldFormatter/ TestFieldNoSettingsFormatter.php, line 20
Namespace
Drupal\field_test\Plugin\Field\FieldFormatterView source
class TestFieldNoSettingsFormatter extends FormatterBase {
/**
* {@inheritdoc}
*/
public function viewElements(FieldItemListInterface $items, $langcode) {
$elements = [];
foreach ($items as $delta => $item) {
// This formatter only needs to output raw for testing.
$elements[$delta] = [
'#markup' => $item->value,
];
}
return $elements;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.