protected function ScheduledPublishGenericFormatter::viewValue in Scheduled Publish 8.2
Same name and namespace in other branches
- 8.3 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 154
Class
- ScheduledPublishGenericFormatter
- Plugin implementation of the 'scheduled_publish_generic_formatter' formatter.
Namespace
Drupal\scheduled_publish\Plugin\Field\FieldFormatterCode
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));
}