You are here

public function PagererParameters::getPagerParameter in Pagerer 8.2

Gets the 'page' query parameter for the current request.

Return value

string The 'page' query parameter for the current request. This is a comma-delimited string of pager element values. Defaults to empty string if the query does not have a 'page' parameter.

Overrides PagerParameters::getPagerParameter

File

src/PagererParameters.php, line 104

Class

PagererParameters
Provides extended pager information contained within the current request.

Namespace

Drupal\pagerer

Code

public function getPagerParameter() {

  // Differs from core in the sense that the string returned is the one
  // identified by the ::querystringKey if the URL is overridden.
  if ($request = $this->requestStack
    ->getCurrentRequest()) {
    if ($this->querystringOverride && $request->query
      ->has($this->querystringKey)) {
      return $request->query
        ->get($this->querystringKey);
    }
    return $request->query
      ->get('page', '');
  }
  return '';
}