PHPackages                             tiloweb/pagination-bundle - 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. [Database &amp; ORM](/categories/database)
4. /
5. tiloweb/pagination-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

tiloweb/pagination-bundle
=========================

A simple and elegant pagination bundle for Symfony using Doctrine ORM Paginator

v3.0.1(2mo ago)731.9k↑34%3MITPHPPHP &gt;=8.1

Since Apr 5Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Tiloweb/SymfonyPaginationBundle)[ Packagist](https://packagist.org/packages/tiloweb/pagination-bundle)[ Docs](https://github.com/Tiloweb/SymfonyPaginationBundle)[ RSS](/packages/tiloweb-pagination-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (22)Used By (0)

TilowebPaginationBundle
=======================

[](#tilowebpaginationbundle)

[![CI](https://github.com/Tiloweb/SymfonyPaginationBundle/actions/workflows/ci.yml/badge.svg)](https://github.com/Tiloweb/SymfonyPaginationBundle/actions/workflows/ci.yml)[![Latest Stable Version](https://camo.githubusercontent.com/32556a0c494ce9a2920b0b0a90c5ae1fb41e6e9b12511aa833e0c76433bd5c0c/68747470733a2f2f706f7365722e707567782e6f72672f74696c6f7765622f706167696e6174696f6e2d62756e646c652f762f737461626c65)](https://packagist.org/packages/tiloweb/pagination-bundle)[![Total Downloads](https://camo.githubusercontent.com/953d0b6b95d895e7aac35051cd4053d3e27bd02ef5393501d79501cae19aca56/68747470733a2f2f706f7365722e707567782e6f72672f74696c6f7765622f706167696e6174696f6e2d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/tiloweb/pagination-bundle)[![License](https://camo.githubusercontent.com/5ae23a43c729ed2b83e00bc3b004f5854c305f0202dc9bfc84df1cd58a6208cb/68747470733a2f2f706f7365722e707567782e6f72672f74696c6f7765622f706167696e6174696f6e2d62756e646c652f6c6963656e7365)](https://packagist.org/packages/tiloweb/pagination-bundle)[![PHP Version](https://camo.githubusercontent.com/d840cef9807c8f76051ad687841d67f4d830c84e0d83236968e53124ef6742d5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d3838393242462e737667)](https://php.net/)

A simple and elegant pagination bundle for Symfony using Doctrine ORM Paginator. This bundle provides an easy-to-use service for paginating database queries and a Twig function for rendering pagination controls.

✨ Features
----------

[](#-features)

- 🚀 **Simple API** - Paginate any Doctrine QueryBuilder with a single method call
- 🎨 **Customizable templates** - Use the default Bootstrap-compatible template or create your own
- ♿ **Accessible** - Default template includes ARIA attributes for screen readers
- 🔧 **Configurable** - Adjust page range, items per page, and template path
- 📦 **Lightweight** - Minimal dependencies, leverages Doctrine's built-in Paginator
- ✅ **Modern PHP** - Strict types, readonly classes, PHP 8.2+ features

📋 Requirements
--------------

[](#-requirements)

- PHP 8.2 or higher
- Symfony 6.4, 7.x, or 8.x
- Doctrine ORM 2.14+ or 3.x
- Twig 3.x

📥 Installation
--------------

[](#-installation)

Install the bundle using Composer:

```
composer require tiloweb/pagination-bundle
```

If you're using Symfony Flex, the bundle will be automatically enabled. Otherwise, add it to your `config/bundles.php`:

```
return [
    // ...
    Tiloweb\PaginationBundle\TilowebPaginationBundle::class => ['all' => true],
];
```

⚙️ Configuration
----------------

[](#️-configuration)

The bundle works out of the box with sensible defaults. You can customize it by creating a configuration file:

```
# config/packages/tiloweb_pagination.yaml
tiloweb_pagination:
    template: '@TilowebPagination/pagination.html.twig'  # Default template
    page_range: 4                                         # Pages shown before/after current
    default_items_per_page: 10                           # Default items per page
```

🚀 Usage
-------

[](#-usage)

### Basic Usage with the Paginator Service

[](#basic-usage-with-the-paginator-service)

```
