public function TwitterWidgetFormatter::view in Twitter Profile Widget 3.x
Same name and namespace in other branches
- 8.2 src/Plugin/Field/FieldFormatter/TwitterWidgetFormatter.php \Drupal\twitter_profile_widget\Plugin\Field\FieldFormatter\TwitterWidgetFormatter::view()
Builds a renderable array for a fully themed field.
Parameters
\Drupal\Core\Field\FieldItemListInterface $items: The field values to be rendered.
string $langcode: (optional) The language that should be used to render the field. Defaults to the current content language.
Return value
array A renderable array for a themed field with its label and all its values.
Overrides FormatterBase::view
File
- src/
Plugin/ Field/ FieldFormatter/ TwitterWidgetFormatter.php, line 45
Class
- TwitterWidgetFormatter
- Plugin implementation of the 'twitter_widget' formatter.
Namespace
Drupal\twitter_profile_widget\Plugin\Field\FieldFormatterCode
public function view(FieldItemListInterface $items, $langcode = NULL) {
$elements = parent::view($items, $langcode);
$elements['#cache']['tags'][] = 'twitter_profile_widget';
return $elements;
}