protected function ContryStateCityFormatter::viewValue in Country, State and City Fields 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 ContryStateCityFormatter::viewValue()
- ContryStateCityFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ ContryStateCityFormatter.php - Builds a renderable array for a field value.
File
- src/
Plugin/ Field/ FieldFormatter/ ContryStateCityFormatter.php, line 139
Class
- ContryStateCityFormatter
- Plugin implementation of the 'contry_state_city_formatter' formatter.
Namespace
Drupal\country_state_city\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->countrylist));
}