We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Sometimes you do not want to show all pages based on results count.
<?php declare(strict_types=1); namespace App\Util; use Pagerfanta\Pagerfanta; use function min; class LimitedPagerfanta extends Pagerfanta { /** * @var int */ private $limitedPageNumber; public function setLimitedPageNumber(int $limitedPageNumber) : LimitedPagerfanta { $this->limitedPageNumber = $limitedPageNumber; return $this; } public function getNbResults() : int { $results = parent::getNbResults(); return (int) min($results, $this->limitedPageNumber * $this->getMaxPerPage()); } }
The text was updated successfully, but these errors were encountered:
Sometimes it needed, but it is better to decorate adapter.
Sorry, something went wrong.
Thanks for your input, @Koc. Do you have any code examples of how you've done this?
Implement LimitedAdapter (closes #244).
143c9c2
@sampart see #261
Thanks, @Koc.
No branches or pull requests
Sometimes you do not want to show all pages based on results count.
The text was updated successfully, but these errors were encountered: