views_ui_test.module

Same filename in other branches
  1. 9 core/modules/views_ui/tests/modules/views_ui_test/views_ui_test.module
  2. 8.9.x core/modules/views_ui/tests/modules/views_ui_test/views_ui_test.module
  3. 10 core/modules/views_ui/tests/modules/views_ui_test/views_ui_test.module

File

core/modules/views_ui/tests/modules/views_ui_test/views_ui_test.module

View source
<?php


/**
 * @file
 * Helper module for Views UI tests.
 */
declare (strict_types=1);

/**
 * Implements hook_views_preview_info_alter().
 *
 * Add a row count row to the live preview area.
 */
function views_ui_test_views_preview_info_alter(&$rows, $view) {
    $data = [
        '#markup' => t('Test row count'),
    ];
    $data['#attached']['library'][] = 'views_ui_test/views_ui_test.test';
    $rows['query'][] = [
        [
            'data' => $data,
        ],
        count($view->result),
    ];
}

Functions

Title Deprecated Summary
views_ui_test_views_preview_info_alter Implements hook_views_preview_info_alter().

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