function template_preprocess_views_ui_views_listing_table

Same name and namespace in other branches
  1. 8.9.x core/modules/views_ui/views_ui.theme.inc \template_preprocess_views_ui_views_listing_table()
  2. 10 core/modules/views_ui/views_ui.theme.inc \template_preprocess_views_ui_views_listing_table()
  3. 11.x core/modules/views_ui/views_ui.theme.inc \template_preprocess_views_ui_views_listing_table()

Prepares variables for Views UI view listing templates.

Default template: views-ui-view-listing-table.html.twig.

Parameters

array $variables: An associative array containing:

  • headers: An associative array containing the headers for the view listing table.
  • rows: An associative array containing the rows data for the view listing table.

File

core/modules/views_ui/views_ui.theme.inc, line 58

Code

function template_preprocess_views_ui_views_listing_table(&$variables) {
    // Convert the attributes to valid attribute objects.
    foreach ($variables['headers'] as $key => $header) {
        $variables['headers'][$key]['attributes'] = new Attribute($header['#attributes']);
    }
    if (!empty($variables['rows'])) {
        foreach ($variables['rows'] as $key => $row) {
            $variables['rows'][$key]['attributes'] = new Attribute($row['#attributes']);
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.