public function PagerDefault::element

public PagerDefault::element($element)

Specify the element ID for this pager query.

The element is used to differentiate different pager queries on the same page so that they may be operated independently. If you do not specify an element, every pager query on the page will get a unique element. If for whatever reason you want to explicitly define an element for a given query, you may do so here.

Setting the element here also increments the static $maxElement counter, which is used for determining the $element when there's none specified.

Note that no collision detection is done when setting an element ID explicitly, so it is possible for two pagers to end up using the same ID if both are set explicitly.

Parameters

$element:

File

includes/pager.inc, line 160
Functions to aid in presenting database results as a set of pages.

Class

PagerDefault
Query extender for pager queries.

Code

public function element($element) {
  $this->element = $element;
  if ($element >= self::$maxElement) {
    self::$maxElement = $element + 1;
  }
  return $this;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!pager.inc/function/PagerDefault::element/7.x