You are here

public static function TableSort::getQueryParameters in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Utility/TableSort.php \Drupal\Core\Utility\TableSort::getQueryParameters()
  2. 9 core/lib/Drupal/Core/Utility/TableSort.php \Drupal\Core\Utility\TableSort::getQueryParameters()

Composes a URL query parameter array for table sorting links.

@internal

Parameters

\Symfony\Component\HttpFoundation\Request|null $request: A current request.

Return value

array A URL query parameter array that consists of all components of the current page request except for those pertaining to table sorting.

1 call to TableSort::getQueryParameters()
template_preprocess_views_view_table in core/modules/views/views.theme.inc
Prepares variables for views table templates.

File

core/lib/Drupal/Core/Utility/TableSort.php, line 179

Class

TableSort
Provides a class for table sorting processing and rendering.

Namespace

Drupal\Core\Utility

Code

public static function getQueryParameters(Request $request) {
  return UrlHelper::filterQueryParameters($request->query
    ->all(), [
    'sort',
    'order',
  ]);
}