hook_views_preview_info_alter

  1. drupal
    1. 6 docs.php function
    2. 7 views.api.php function
Drupal 7 hook_views_preview_info_alter(&$rows, $view)

This hook should be placed in MODULENAME.views.inc and it will be auto-loaded. MODULENAME.views.inc must be in the directory specified by the 'path' key returned by MODULENAME_views_api(), or the same directory as the .module file, if 'path' is unspecified.

Alter the rows that appear with a view preview, which include query and performance statistics. $rows is an associative array with two keys:

  • query: An array of rows suitable for theme('table'), containing information about the query and the display title and path.
  • statistics: An array of rows suitable for theme('table'), containing performance statistics.

Warning: $view is not a reference in PHP4 and cannot be modified here. But it IS a reference in PHP5, and can be modified. Please be careful with it.

See also

theme_table

Related topics

1 invocation of hook_views_preview_info_alter()

File

sites/all/modules/views/docs/views.api.php, line 726
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function hook_views_preview_info_alter(&$rows, $view) {
  // example code here
}