public function GridStackFileFormatterBase::viewElements in GridStack 8.2
Same name and namespace in other branches
- 8 src/Plugin/Field/FieldFormatter/GridStackFileFormatterBase.php \Drupal\gridstack\Plugin\Field\FieldFormatter\GridStackFileFormatterBase::viewElements()
File
- src/
Plugin/ Field/ FieldFormatter/ GridStackFileFormatterBase.php, line 37
Class
- GridStackFileFormatterBase
- Base class for gridstack image and file ER formatters.
Namespace
Drupal\gridstack\Plugin\Field\FieldFormatterCode
public function viewElements(FieldItemListInterface $items, $langcode) {
$entities = $this
->getEntitiesToView($items, $langcode);
// Early opt-out if the field is empty.
if (empty($entities)) {
return [];
}
return $this
->commonViewElements($items, $langcode, $entities);
}