function ClaroHooks::preprocessViewsViewTable
Same name and namespace in other branches
- 11.x core/themes/claro/src/Hook/ClaroHooks.php \Drupal\claro\Hook\ClaroHooks::preprocessViewsViewTable()
Implements hook_preprocess_HOOK() for views_view_table.
@todo Revisit after https://www.drupal.org/node/3025726 or https://www.drupal.org/node/1973418 is in.
Attributes
#[Hook('preprocess_views_view_table')]
File
-
core/
themes/ claro/ src/ Hook/ ClaroHooks.php, line 982
Class
- ClaroHooks
- Hook implementations for claro.
Namespace
Drupal\claro\HookCode
public function preprocessViewsViewTable(&$variables) : void {
if (!empty($variables['header'])) {
foreach ($variables['header'] as &$header_cell) {
if (!empty($header_cell['url'])) {
$parsed_url = UrlHelper::parse($header_cell['url']);
$query = !empty($parsed_url['query']) ? $parsed_url['query'] : [];
if (isset($query['order']) && isset($query['sort'])) {
$header_cell['attributes']->addClass('sortable-heading');
}
}
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.