You are here

public function ParagraphsTableFormatter::getTable in Paragraphs table 8

1 call to ParagraphsTableFormatter::getTable()
ParagraphsTableFormatter::viewElements in src/Plugin/Field/FieldFormatter/ParagraphsTableFormatter.php
Builds a renderable array for a field value.

File

src/Plugin/Field/FieldFormatter/ParagraphsTableFormatter.php, line 551

Class

ParagraphsTableFormatter
Plugin implementation of the 'paragraphs_table_formatter' formatter.

Namespace

Drupal\paragraphs_table\Plugin\Field\FieldFormatter

Code

public function getTable($table_columns, $table_rows, $entities) {
  $table = [
    '#theme' => 'table',
    '#rows' => $table_rows,
    '#header' => $table_columns,
  ];
  $this
    ->cacheMetadata($entities, $table);
  return $table;
}