You are here

public function LayoutParagraphsFormatter::viewElements in Layout Paragraphs 1.0.x

File

src/Plugin/Field/FieldFormatter/LayoutParagraphsFormatter.php, line 78

Class

LayoutParagraphsFormatter
Layout Paragraphs field formatter.

Namespace

Drupal\layout_paragraphs\Plugin\Field\FieldFormatter

Code

public function viewElements(FieldItemListInterface $items, $langcode) {
  $build = $this
    ->buildLayoutTree($items, $langcode);
  $elements = [];
  foreach ($build as $element) {
    $elements[] = $element;
  }
  return $elements;
}