{"id":20862390,"url":"https://github.com/dimmir/paginatorbundle","last_synced_at":"2026-04-21T09:33:33.036Z","repository":{"id":56969192,"uuid":"91322912","full_name":"dimmir/PaginatorBundle","owner":"dimmir","description":"Flexible pagination bundle for Symfony 3. Created for use on the REST AP","archived":false,"fork":false,"pushed_at":"2017-05-24T05:51:46.000Z","size":76,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T07:42:25.176Z","etag":null,"topics":["pagination","paginator","rest-api","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dimmir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-15T10:00:47.000Z","updated_at":"2018-02-11T16:23:38.000Z","dependencies_parsed_at":"2022-08-21T06:40:16.749Z","dependency_job_id":null,"html_url":"https://github.com/dimmir/PaginatorBundle","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimmir%2FPaginatorBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimmir%2FPaginatorBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimmir%2FPaginatorBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimmir%2FPaginatorBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimmir","download_url":"https://codeload.github.com/dimmir/PaginatorBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243234082,"owners_count":20258391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pagination","paginator","rest-api","symfony","symfony-bundle"],"created_at":"2024-11-18T05:21:28.207Z","updated_at":"2026-04-21T09:33:32.974Z","avatar_url":"https://github.com/dimmir.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PaginatorBundle\n\nFlexible pagination bundle for Symfony 3.\nThis bundle provides an easy way to add pagination support to the collection of your API.\nIt easy used with FOSRestBundle\n\n[![Build Status](https://travis-ci.org/dimmir/PaginatorBundle.svg?branch=master)](https://travis-ci.org/dimmir/PaginatorBundle) [![Coverage Status](https://coveralls.io/repos/github/dimmir/PaginatorBundle/badge.svg?branch=master)](https://coveralls.io/github/dimmir/PaginatorBundle?branch=master) [![Dependency Status](https://www.versioneye.com/user/projects/5924edc085cd28003240f45f/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/5924edc085cd28003240f45f)\n\n\n## Installation:\n\nYou can install this bundle using composer:\n\n```sh\ncomposer require dimmir/paginator-bundle\n```\n\nAdd the bundle to your AppKernel.php file:\n\n```php\n// app/AppKernel.php\npublic function registerBundles()\n{\n    return array(\n        // ...\n        new DMR\\Bundle\\PaginatorBundle\\PaginatorBundle(),\n        // ...\n    );\n}\n```\n\n## Configuration\n\n```yaml\ndmr_paginator:\n    items_per_page: 25                                  # default number items per page\n    max_items_per_page: ~                               # The maximum number of items per page.\n    page_request_parameter_name: page                   # The name of current page for query parameter\n    client_items_per_page: false                        # To allow the client to set the number of items per page.\n    items_per_page_request_parameter_name: itemsPerPage # The name of items per page query parameter\n    options:                                            # options fo Paginator\n        fetch_join_collection: true                     # The option fetchJoinCollection for Doctrine ORM Paginator\n```\n\n## Usage\n\nCurrently paginator can paginate:\n\n- `Doctrine\\ORM\\QueryBuilder`\n\nExample for used with FOSRestBundle:\n\n\n```php\n// AppBundle\\Controller\\UserController.php\n\n    /**\n     * @View()\n     */\n    public function cgetAction (Request $request)\n    {\n        $queryBuilder = $this-\u003egetDoctrine()-\u003egetManager()\n                    -\u003egetRepository('AppBundle:User')-\u003ecreateQueryBuilder('u');\n\n        $paginator = $this-\u003eget('dmr_paginator.service')-\u003epagination($queryBuilder);\n\n        return new SliderRepresentation($paginator);\n    }\n```\n\n### Representations\n\nDMR\\Bundle\\PaginatorBundle\\Representation\\CollectionRepresentation:\n\n```json\n{\n  \"items\": [\n    {\n      \"id\": 1,\n    },\n  ],\n  \"pagination\": {\n    \"page\": 1,\n    \"itemsPerPage\": 25,\n    \"totalItemsCount\": 40,\n    \"pagesCount\": 2\n  }\n}\n```\n\nDMR\\Bundle\\PaginatorBundle\\Representation\\SliderRepresentation:\n\n```json\n{\n  \"items\": [\n    {\n      \"id\": 1,\n    },\n  ],\n  \"previus\": 1,\n  \"next\": 3\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimmir%2Fpaginatorbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimmir%2Fpaginatorbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimmir%2Fpaginatorbundle/lists"}