function hook_views_analyze
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.
1 invocation of hook_views_analyze()
- Analyzer::getMessages in core/
modules/ views/ src/ Analyzer.php - Analyzes a review and return the results.
File
-
core/
modules/ views/ views.api.php, line 92
Code
function hook_views_analyze(ViewExecutable $view) {
$messages = [];
if ($view->display_handler->options['pager']['type'] == 'none') {
$messages[] = Analyzer::formatMessage(t('This view has no pager. This could cause performance issues when the view contains many items.'), 'warning');
}
return $messages;
}