function PagerParametersInterface::findPage
Same name in other branches
- 9 core/lib/Drupal/Core/Pager/PagerParametersInterface.php \Drupal\Core\Pager\PagerParametersInterface::findPage()
- 8.9.x core/lib/Drupal/Core/Pager/PagerParametersInterface.php \Drupal\Core\Pager\PagerParametersInterface::findPage()
- 10 core/lib/Drupal/Core/Pager/PagerParametersInterface.php \Drupal\Core\Pager\PagerParametersInterface::findPage()
Returns the current page being requested for display within a pager.
Parameters
int $pager_id: (optional) An integer to distinguish between multiple pagers on one page.
Return value
int The number of the current requested page, within the pager represented by $element. This is determined from the URL query parameter \Drupal::request()->query->get('page'), or 0 by default. Note that this number may differ from the actual page being displayed. For example, if a search for "example text" brings up three pages of results, but a user visits search/node/example+text?page=10, this function will return 10, even though the default pager implementation adjusts for this and still displays the third page of search results at that URL.
1 method overrides PagerParametersInterface::findPage()
- PagerParameters::findPage in core/
lib/ Drupal/ Core/ Pager/ PagerParameters.php - Returns the current page being requested for display within a pager.
File
-
core/
lib/ Drupal/ Core/ Pager/ PagerParametersInterface.php, line 37
Class
- PagerParametersInterface
- Interface describing pager information contained within the request.
Namespace
Drupal\Core\PagerCode
public function findPage($pager_id = 0);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.