You are here

public function PagerParameters::getQueryParameters in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Pager/PagerParameters.php \Drupal\Core\Pager\PagerParameters::getQueryParameters()

Gets all request URL query parameters that are unrelated to paging.

Return value

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

Overrides PagerParametersInterface::getQueryParameters

File

core/lib/Drupal/Core/Pager/PagerParameters.php, line 35

Class

PagerParameters
Provides pager information contained within the current request.

Namespace

Drupal\Core\Pager

Code

public function getQueryParameters() {
  $request = $this->requestStack
    ->getCurrentRequest();
  if ($request) {
    return UrlHelper::filterQueryParameters($request->query
      ->all(), [
      'page',
    ]);
  }
  return [];
}