PHPackages                             beberlei/porpaginas - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. beberlei/porpaginas

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

beberlei/porpaginas
===================

Library that generically solves several pagination issues with DAO/repository abstractions.

v2.3(2mo ago)163612.6k—7.3%1911MITPHPPHP ^8CI passing

Since Sep 17Pushed 2mo ago9 watchersCompare

[ Source](https://github.com/beberlei/porpaginas)[ Packagist](https://packagist.org/packages/beberlei/porpaginas)[ RSS](/packages/beberlei-porpaginas/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (17)Versions (11)Used By (11)

Porpaginas
==========

[](#porpaginas)

[![Build Status](https://camo.githubusercontent.com/e002178c276b7c781172d4bef8d51bd80b794c26c7aaa88a375a422a6800b8c4/68747470733a2f2f7472617669732d63692e6f72672f62656265726c65692f706f72706167696e61732e737667)](https://travis-ci.org/beberlei/porpaginas)

This library solves a bunch of issues that comes up with APIs of Repository classes alot:

- You need different methods for paginatable and non-paginatable finder methods.
- You need to expose the underlying data-source and return query objects from your repository.
- Serialization of paginators should be easily possible for REST APIs

Both Pagerfanta and KnpLabs Pager don't solve this issue and their APIs are really problematic in this regard. You need to return the query objects or adapters for paginators from your repositories to get it working and then use an API on the controller side to turn them into a paginated result set.

Porpaginas solves this by introducing a sane abstraction for paginated results. For rendering purposes you can integrate with either Pagerfanta or KnpLabs Pager, this library is not about reimplementating the view part of pagination.

Central part of this library is the interface `Result`:

```
