You are here

protected function MetatagViewsController::buildDisplayDetailsTable in Metatag 8

Build the table with metatag values summary.

Parameters

array $tags: The tags to process.

Return value

array The tag structure in a display element.

1 call to MetatagViewsController::buildDisplayDetailsTable()
MetatagViewsController::buildViewDetails in metatag_views/src/Controller/MetatagViewsController.php
Builds the second "level" of the UI table with display fieldset and ops.

File

metatag_views/src/Controller/MetatagViewsController.php, line 181

Class

MetatagViewsController
Class MetatagViewsController.

Namespace

Drupal\metatag_views\Controller

Code

protected function buildDisplayDetailsTable(array $tags) {
  $element = [
    '#type' => 'table',
  ];
  $i = 0;
  foreach ($tags as $tag_name => $tag_value) {

    // This is for the case where we have a subarray.
    $tag_value = $this
      ->prepareTagValue($tag_value);
    if (!$tag_value) {
      continue;
    }
    $element[$i]['tag_name'] = [
      '#type' => 'markup',
      '#markup' => $tag_name,
    ];
    $element[$i]['tag_value'] = [
      '#type' => 'markup',
      '#markup' => $tag_value,
    ];
    $i++;
  }
  return $element;
}