You are here

protected function ClipboardJs::viewValue in Clipboard.js 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Field/FieldFormatter/ClipboardJs.php \Drupal\clipboardjs\Plugin\Field\FieldFormatter\ClipboardJs::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.

1 call to ClipboardJs::viewValue()
ClipboardJs::viewElements in src/Plugin/Field/FieldFormatter/ClipboardJs.php
Builds a renderable array for a field value.

File

src/Plugin/Field/FieldFormatter/ClipboardJs.php, line 74

Class

ClipboardJs
Plugin implementation of the 'clipboard' formatter.

Namespace

Drupal\clipboardjs\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));
}