protected function ColorboxFieldFormatterImage::viewValue in Colorbox field formatter 8
Same name and namespace in other branches
- 2.0.x src/Plugin/Field/FieldFormatter/ColorboxFieldFormatterImage.php \Drupal\colorbox_field_formatter\Plugin\Field\FieldFormatter\ColorboxFieldFormatterImage::viewValue()
Generate the output appropriate for one field item.
Parameters
\Drupal\Core\Field\FieldItemInterface $item: One field item.
Return value
string|array The textual output generated.
Overrides ColorboxFieldFormatter::viewValue
File
- src/
Plugin/ Field/ FieldFormatter/ ColorboxFieldFormatterImage.php, line 72
Class
- ColorboxFieldFormatterImage
- Plugin implementation of the 'colorbox_field_formatter' formatter for images.
Namespace
Drupal\colorbox_field_formatter\Plugin\Field\FieldFormatterCode
protected function viewValue(FieldItemInterface $item) {
return $item
->view([
'settings' => [
'image_style' => $this
->getSetting('image_style'),
],
]);
}