protected function NifFormatter::viewValue in Field NIF 8
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 NifFormatter::viewValue()
- NifFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ NifFormatter.php - Builds a renderable array for a field value.
File
- src/
Plugin/ Field/ FieldFormatter/ NifFormatter.php, line 45
Class
- NifFormatter
- Plugin implementation of the 'nif_default' formatter.
Namespace
Drupal\field_nif\Plugin\Field\FieldFormatterCode
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 Html::escape($item->value);
}