protected function OpignoTrueFalseFormatterType::viewValue in Opigno module 8
Same name and namespace in other branches
- 3.x src/Plugin/Field/FieldFormatter/OpignoTrueFalseFormatterType.php \Drupal\opigno_module\Plugin\Field\FieldFormatter\OpignoTrueFalseFormatterType::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 OpignoTrueFalseFormatterType::viewValue()
- OpignoTrueFalseFormatterType::viewElements in src/
Plugin/ Field/ FieldFormatter/ OpignoTrueFalseFormatterType.php - Builds a renderable array for a field value.
File
- src/
Plugin/ Field/ FieldFormatter/ OpignoTrueFalseFormatterType.php, line 69
Class
- OpignoTrueFalseFormatterType
- Plugin implementation of the 'opigno_true_false_formatter_type' formatter.
Namespace
Drupal\opigno_module\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 nl2br(Html::escape($item->value));
}