Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add page start end total to PagerRenderer #9371

Prev Previous commit
Next Next commit
Fix CR issues.
  • Loading branch information
murilohpucci committed Jan 6, 2025
commit 5b8459444643001763e952dfa8fda1a4ecf704c6
2 changes: 1 addition & 1 deletion system/Pager/PagerRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ protected function updatePerPages(): void
return;
}

// When the page is the last, performs a different calculation.
// When the page is the last, perform a different calculation.
if ($this->last === $this->current) {
$this->perPageStart = $this->perPage * ($this->current - 1) + 1;
$this->perPageEnd = $this->total;
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Pager/PagerRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,8 @@ public function testPageStartEnd(array $details, int $pageStart, int $pageEnd):
$pager = new PagerRenderer($details);
$pager->setSurroundCount(2);

$this->assertSame($pager->getPerPageStart(), $pageStart);
$this->assertSame($pager->getPerPageEnd(), $pageEnd);
$this->assertSame($pageStart, $pager->getPerPageStart());
$this->assertSame($pageEnd, $pager->getPerPageEnd());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/changelogs/v4.6.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ Pagination
==========

- Added a new feature to get the total and the range number of items of the current page.
See the section ``Displaying the Number of Items on the Page`` of the :ref:`displaying-the-number-of-items-on-the-page` for more details.
See :ref:`Displaying the Number of Items on the Page <displaying-the-number-of-items-on-the-page>` for more details.

Testing
=======
Expand Down