You are here

public function CleanPager::cleanPagerIsPagerElement in Clean Pagination 8

1 call to CleanPager::cleanPagerIsPagerElement()
CleanPager::rewriteUrl in src/StackMiddleware/CleanPager.php

File

src/StackMiddleware/CleanPager.php, line 104

Class

CleanPager
Provides a HTTP middleware.

Namespace

Drupal\cleanpager\StackMiddleware

Code

public function cleanPagerIsPagerElement($value) {
  if (is_numeric($value)) {
    return TRUE;
  }

  // Handle multiple pagers (i.e. 0,0,1,0);
  $parts = explode(',', $value);
  foreach ($parts as $p) {
    if (!is_numeric($p)) {
      return FALSE;
    }
  }
  return TRUE;
}