PHPackages                             rebolon/pager-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rebolon/pager-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

rebolon/pager-bundle
====================

Bundle to use Pager with Symfony2

615PHP

Since Feb 7Pushed 13y ago2 watchersCompare

[ Source](https://github.com/Rebolon/PagerBundle)[ Packagist](https://packagist.org/packages/rebolon/pager-bundle)[ RSS](/packages/rebolon-pager-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

README
======

[](#readme)

Here is a simple Pager for Symfony2

[![Build Status](https://camo.githubusercontent.com/7c1433daeaa13290495de4d017ee37a50de1866587ff11d8b6aa90497a704757/68747470733a2f2f7472617669732d63692e6f72672f5265626f6c6f6e2f506167657242756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Rebolon/PagerBundle)

Why do you need a pager ? Because you have a too many item to display on a page. But there is two possibility :

- You want to retreive only items to display. In that case the pager must be able to display those items and create the pager caracteristic
- You have already retreived a huge list (from a web service). In that case the pager must display only items of the current page, and also the pager caracteristic

For the first case, my pager can help you to get limit and offset value to allow you to retreive only wanted data.

Features
--------

[](#features)

- Twig template support (classic and twitter boostrap template)
- Easy to customize and extend

Installation
------------

[](#installation)

Add the namespaces to your autoloader in the app/autoload.php :

```
``` php
'Rebolon'          => __DIR__.'/../src',
```

```

Add PaginatorBundle to your application kernel in the app/AppKernel.php :

```
``` php
new Rebolon\PagerBundle\RebolonPagerBundle(),
```

```

Sample
------

[](#sample)

All you need is to know how many data the pager may manage (the totalItem). By default the pager has 5 items inside (1 to 5), and manage 15 items in the list that you want to display. So you can use the container to simply use the pager :

```
``` php
$this->get('rebolon_pager.pager');
```

```

There is a sample in the default controller with route rebolon/pager/test

You can also configure your own Pager for all your bundle, simply add this to the services.xml of your bundle :

```
``` xml

         pagerForWS

         5

         3

```

```

To get your offset/limit values, use the methods specified in PagerInterface :

- first you need to do a count(\*) on the list you want to display. Then give the value to the init method of the pager.
- use the methods getOffset(), and getItemPerPageParam() to retreive offset and limit values for your query

Inside the template, the pager gives you anything you need to create display your pager :

- buildPager will create the pager item list (first/prev/X...Y/next/last). It returns an array of associative array which keys are uri/label/title.
- isCurrentPage($pageId) allow you to identity if item your looping into is the currentPage
- isToDisplay($itemIndex) allow you to know if an item of the list must be displayed or not Have a look at the PagerTplInterface for others methods.

There is few twig template to illustrate the possibility of the pager :

- standard is a classic pager
- twt-bs is a pager that use bootstrap twitter css framework
- test and tewtWithLargeList are used by the demo controller of the bundle. They are samples for first and second case i spoke about at the begining of the README

Have fun with it !

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/93af00da41678fc6e137333b3fe8caaeedbd931c0b4ac6166a2a36005bb263b2?d=identicon)[rebolon](/maintainers/rebolon)

---

Top Contributors

[![Rebolon](https://avatars.githubusercontent.com/u/1201755?v=4)](https://github.com/Rebolon "Rebolon (17 commits)")

### Embed Badge

![Health badge](/badges/rebolon-pager-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/rebolon-pager-bundle/health.svg)](https://phpackages.com/packages/rebolon-pager-bundle)
```

###  Alternatives

[adoy/fastcgi-client

Lightweight, single file FastCGI client for PHP.

3142.6M9](/packages/adoy-fastcgi-client)[willvincent/feeds

Laravel Service Provider for the SimplePie library

3131.5M2](/packages/willvincent-feeds)[voku/stringy

A string manipulation library with multibyte support

1783.8M19](/packages/voku-stringy)[anthonymartin/geo-location

Powerful GeoCoding library: Retrieve bounding box coordinates, distances between geopoints, point in polygon, get longitude and latitude from addresses and more with GeoLocation for PHP

196949.5k5](/packages/anthonymartin-geo-location)[backpack/basset

Dead-simple way to load CSS or JS assets only once per page, when using Laravel 10+.

202832.4k6](/packages/backpack-basset)[codeigniter4/settings

Settings library for CodeIgniter 4

93499.3k24](/packages/codeigniter4-settings)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
