function template_preprocess_views_bootstrap_table in Views Bootstrap 8.4
Same name and namespace in other branches
- 8.3 views_bootstrap.theme.inc \template_preprocess_views_bootstrap_table()
Prepares variables for views table templates.
Default template: views-bootstrap-table.html.twig.
Parameters
array $vars: An associative array containing:
- view: A ViewExecutable object.
- rows: The raw row data.
1 string reference to 'template_preprocess_views_bootstrap_table'
- ViewsBootstrap::getThemeHooks in src/
ViewsBootstrap.php - Returns the theme hook definition information.
File
- ./
views_bootstrap.theme.inc, line 253 - Preprocessors and helper functions to make theming easier.
Code
function template_preprocess_views_bootstrap_table(array &$vars) {
$vars['responsive'] = $vars['view']->style_plugin->options['responsive'];
$vars['attributes']['class'][] = 'table';
foreach (array_filter($vars['view']->style_plugin->options['bootstrap_styles']) as $style) {
$vars['attributes']['class'][] = 'table-' . $style;
}
}