function template_preprocess_uikit_view_table in UIkit Components 8
Same name and namespace in other branches
- 8.3 uikit_views/includes/uikit_views.theme.inc \template_preprocess_uikit_view_table()
- 8.2 uikit_views/includes/uikit_views.theme.inc \template_preprocess_uikit_view_table()
- 7.3 uikit_views/templates/uikit_views.theme.inc \template_preprocess_uikit_view_table()
- 7.2 uikit_views/templates/uikit_views.theme.inc \template_preprocess_uikit_view_table()
Prepares variables for UIkit Table templates.
Default template: uikit-view-table.html.twig.
Parameters
array $variables: An associative array containing:
- view: A ViewExecutable object.
- rows: The raw row data.
1 string reference to 'template_preprocess_uikit_view_table'
- UIkitViews::getThemeHooks in uikit_views/
src/ UIkitViews.php - Returns the theme hook definition information for UIkit Views.
File
- uikit_views/
includes/ uikit_views.theme.inc, line 82 - Preprocessors and helper functions to make theming easier.
Code
function template_preprocess_uikit_view_table(array &$variables) {
$view = $variables['view'];
$options = $view->style_plugin->options;
// Add additional options as variables.
$variables['responsive_table'] = $options['responsive_table'];
$variables['vertical_modifier'] = $options['vertical_modifier'];
// Add each table modifier option as variables.
$table_modifiers = $options['table_modifiers'];
foreach ($table_modifiers as $modifier_key => $modifier) {
$variables[$modifier_key] = $modifier;
}
}