You are here

protected function ColorboxFieldFormatterEntityreference::viewValue in Colorbox field formatter 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Field/FieldFormatter/ColorboxFieldFormatterEntityreference.php \Drupal\colorbox_field_formatter\Plugin\Field\FieldFormatter\ColorboxFieldFormatterEntityreference::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/ColorboxFieldFormatterEntityreference.php, line 35

Class

ColorboxFieldFormatterEntityreference
Plugin implementation of the 'colorbox_field_formatter' formatter for entityreferences.

Namespace

Drupal\colorbox_field_formatter\Plugin\Field\FieldFormatter

Code

protected function viewValue(FieldItemInterface $item) {

  /** @noinspection PhpUndefinedFieldInspection */
  return $item->entity
    ->label();
}