You are here

protected function DropdownFieldFormatter::viewValue in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php \Drupal\dropdown\Plugin\Field\FieldFormatter\DropdownFieldFormatter::viewValue()
  2. 8.2 modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php \Drupal\dropdown\Plugin\Field\FieldFormatter\DropdownFieldFormatter::viewValue()
  3. 8.3 modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php \Drupal\dropdown\Plugin\Field\FieldFormatter\DropdownFieldFormatter::viewValue()
  4. 8.4 modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php \Drupal\dropdown\Plugin\Field\FieldFormatter\DropdownFieldFormatter::viewValue()
  5. 8.5 modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php \Drupal\dropdown\Plugin\Field\FieldFormatter\DropdownFieldFormatter::viewValue()
  6. 8.6 modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php \Drupal\dropdown\Plugin\Field\FieldFormatter\DropdownFieldFormatter::viewValue()
  7. 8.7 modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php \Drupal\dropdown\Plugin\Field\FieldFormatter\DropdownFieldFormatter::viewValue()
  8. 8.8 modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php \Drupal\dropdown\Plugin\Field\FieldFormatter\DropdownFieldFormatter::viewValue()
  9. 10.3.x modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php \Drupal\dropdown\Plugin\Field\FieldFormatter\DropdownFieldFormatter::viewValue()
  10. 10.0.x modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php \Drupal\dropdown\Plugin\Field\FieldFormatter\DropdownFieldFormatter::viewValue()
  11. 10.1.x modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php \Drupal\dropdown\Plugin\Field\FieldFormatter\DropdownFieldFormatter::viewValue()
  12. 10.2.x modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php \Drupal\dropdown\Plugin\Field\FieldFormatter\DropdownFieldFormatter::viewValue()

Generate the output appropriate for one field item.

Parameters

\Drupal\Core\Field\FieldItemInterface $item: One field item.

Return value

string The textual output generated.

1 call to DropdownFieldFormatter::viewValue()
DropdownFieldFormatter::viewElements in modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php
Builds a renderable array for a field value.

File

modules/custom/dropdown/src/Plugin/Field/FieldFormatter/DropdownFieldFormatter.php, line 44

Class

DropdownFieldFormatter
Plugin implementation of the 'dropdown_field_formatter' formatter.

Namespace

Drupal\dropdown\Plugin\Field\FieldFormatter

Code

protected function viewValue(FieldItemInterface $item) {

  // The text value has no text format assigned to it, so the user input
  // should equal the output, including newlines.
  return $this
    ->getLabelForValue($item->value);
}