You are here

protected function StatusMessageFormatter::viewValue in Heartbeat 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 StatusMessageFormatter::viewValue()
StatusMessageFormatter::viewElements in modules/statusmessage/src/Plugin/Field/FieldFormatter/StatusMessageFormatter.php
Builds a renderable array for a field value.

File

modules/statusmessage/src/Plugin/Field/FieldFormatter/StatusMessageFormatter.php, line 74

Class

StatusMessageFormatter
Plugin implementation of the 'status_message_formatter' formatter.

Namespace

Drupal\statusmessage\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 nl2br(Html::escape($item->value));
}