PHPackages                             rebolon/pager-component - 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-component

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

rebolon/pager-component
=======================

simple pager component. It gives a simple API to manage your own pager.

067PHP

Since Jan 10Pushed 13y ago1 watchersCompare

[ Source](https://github.com/Rebolon/PagerComponent)[ Packagist](https://packagist.org/packages/rebolon/pager-component)[ RSS](/packages/rebolon-pager-component/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/922433ac7851f116dfdd22ed65052d40aedbe0310809a7f9b8e25c52d31cf65f/68747470733a2f2f7472617669732d63692e6f72672f5265626f6c6f6e2f5061676572436f6d706f6e656e742e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Rebolon/PagerComponent)

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

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

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 (4 commits)")

### Embed Badge

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

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

PHPackages © 2026

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