You are here

protected function ScheduledPublishGenericFormatter::viewValue in Scheduled Publish 8.3

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/ScheduledPublishGenericFormatter.php \Drupal\scheduled_publish\Plugin\Field\FieldFormatter\ScheduledPublishGenericFormatter::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.

File

src/Plugin/Field/FieldFormatter/ScheduledPublishGenericFormatter.php, line 155

Class

ScheduledPublishGenericFormatter
Plugin implementation of the 'scheduled_publish_generic_formatter' formatter.

Namespace

Drupal\scheduled_publish\Plugin\Field\FieldFormatter

Code

protected function viewValue(FieldItemInterface $item) : string {

  // 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));
}