Same name and namespace in other branches
- 8.x-2.x src/Plugin/Field/FieldFormatter/ColorFieldFormatterText.php \Drupal\color_field\Plugin\Field\FieldFormatter\ColorFieldFormatterText::viewElements() 1 comment
File
-
src/
Plugin/ Field/ FieldFormatter/ ColorFieldFormatterText.php, line 77
Class
- ColorFieldFormatterText
- Plugin implementation of the color_field text formatter.
Namespace
Drupal\color_field\Plugin\Field\FieldFormatterCode
public function viewElements(FieldItemListInterface $items, $langcode) : array {
$elements = [];
foreach ($items as $delta => $item) {
$elements[$delta] = [
'#markup' => $this->viewValue($item),
];
}
return $elements;
}