class OptionsKeyFormatter
Same name in other branches
- 9 core/modules/options/src/Plugin/Field/FieldFormatter/OptionsKeyFormatter.php \Drupal\options\Plugin\Field\FieldFormatter\OptionsKeyFormatter
- 8.9.x core/modules/options/src/Plugin/Field/FieldFormatter/OptionsKeyFormatter.php \Drupal\options\Plugin\Field\FieldFormatter\OptionsKeyFormatter
- 10 core/modules/options/src/Plugin/Field/FieldFormatter/OptionsKeyFormatter.php \Drupal\options\Plugin\Field\FieldFormatter\OptionsKeyFormatter
Plugin implementation of the 'list_key' formatter.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
- class \Drupal\Core\Field\PluginSettingsBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Field\PluginSettingsInterface, \Drupal\Component\Plugin\DependentPluginInterface
- class \Drupal\Core\Field\FormatterBase extends \Drupal\Core\Field\PluginSettingsBase implements \Drupal\Core\Field\FormatterInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface
- class \Drupal\options\Plugin\Field\FieldFormatter\OptionsKeyFormatter extends \Drupal\Core\Field\FormatterBase
- class \Drupal\Core\Field\FormatterBase extends \Drupal\Core\Field\PluginSettingsBase implements \Drupal\Core\Field\FormatterInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface
- class \Drupal\Core\Field\PluginSettingsBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Field\PluginSettingsInterface, \Drupal\Component\Plugin\DependentPluginInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
Expanded class hierarchy of OptionsKeyFormatter
File
-
core/
modules/ options/ src/ Plugin/ Field/ FieldFormatter/ OptionsKeyFormatter.php, line 14
Namespace
Drupal\options\Plugin\Field\FieldFormatterView source
class OptionsKeyFormatter extends FormatterBase {
/**
* {@inheritdoc}
*/
public function viewElements(FieldItemListInterface $items, $langcode) {
$elements = [];
foreach ($items as $delta => $item) {
$elements[$delta] = [
'#markup' => $item->value,
'#allowed_tags' => FieldFilteredMarkup::allowedTags(),
];
}
return $elements;
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.