You are here

protected function DefaultFileFormatter::viewValue in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/file/src/Plugin/Field/FieldFormatter/DefaultFileFormatter.php \Drupal\file\Plugin\Field\FieldFormatter\DefaultFileFormatter::viewValue()
  2. 10 core/modules/file/src/Plugin/Field/FieldFormatter/DefaultFileFormatter.php \Drupal\file\Plugin\Field\FieldFormatter\DefaultFileFormatter::viewValue()

Generate the output appropriate for one field item.

Parameters

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

Return value

mixed The textual output generated.

Overrides BaseFieldFileFormatterBase::viewValue

File

core/modules/file/src/Plugin/Field/FieldFormatter/DefaultFileFormatter.php, line 42

Class

DefaultFileFormatter
Formatter for a text field on a file entity that links the field to the file.

Namespace

Drupal\file\Plugin\Field\FieldFormatter

Code

protected function viewValue(FieldItemInterface $item) {
  return $item->value;
}