hook_views_analyze(Drupal\views\ViewExecutable $view)
Analyze a view to provide warnings about its configuration.
Parameters
\Drupal\views\ViewExecutable $view: The view being executed.
Return value
array Array of warning messages built by Analyzer::formatMessage to be displayed to the user following analysis of the view.
Related topics
- Hooks
- Define functions that alter the behavior of Drupal core.
File
- core/modules/views/views.api.php, line 95
- Describes hooks and plugins provided by the Views module.
Code
1 2 3 4 5 6 7 8 9 | function hook_views_analyze(Drupal\views\ViewExecutable $view ) { $messages = array (); if ( $view ->display_handler->options[ 'pager' ][ 'type' ] == 'none' ) { $messages [] = Drupal\views\Analyzer::formatMessage(t( 'This view has no pager. This could cause performance issues when the view contains many items.' ), 'warning' ); } return $messages ; } |
Please login to continue.