PHPackages                             swoopaholic/pagerfanta-bridge - 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. swoopaholic/pagerfanta-bridge

ActiveSwoopaholic-bridge

swoopaholic/pagerfanta-bridge
=============================

Swoopaholic Pagerfanta Bridge

1.0.1(10y ago)01.1kMITPHPPHP &gt;=5.3.3

Since May 22Pushed 10y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (3)Used By (0)

Pagerfanta Bridge
=================

[](#pagerfanta-bridge)

This small library is intended to remove the dependency on the Pagerfanta bundle and it's twig extensions. By using the view, you can create a template to render the pager.

Usage
-----

[](#usage)

Just download the library and use it in your symfony2 project controller:

```
/**
 * Lists all entities.
 *
 * @Route("/", name="my_entities")
 * @Method("GET")
 * @Template()
 */
public function indexAction(Request $request)
{
    $qb = $this->getDoctrine()->getManager()->createQueryBuilder('MyBundle:MyEntity');
    $adapter = new \Pagerfanta\Adapter\DoctrineORMAdapter($qb);

    $pager = new \Swoopaholic\Bridge\Pagerfanta\Pagerfanta($adapter);
    $pager->setCurrentPage($request->get('page', 1));
    $pager->setMaxPerPage(50);

    return array(
        'entities' => $pager->getData(),
        'pagerfanta' => $pager->createView(),
    );
```

Create a macro template for rendering the pager:

```
{% block page_first %}
    &laquo;
{% endblock %}

{% block page_last %}
    = pager.pages|length %} class="disabled"{% endif %}>&raquo;
{% endblock %}

{% block page_prev %}
    &larr;
{% endblock %}

{% block page_next %}
    = pager.pages|length %} class="disabled"{% endif %}>&rarr;
{% endblock %}

{% block page_link %}
    {{ item.content }}
{% endblock %}

{% macro pager(pager) %}
    {% if pager.count > 1 %}

            {{ block('page_first') }}
            {{ block('page_prev') }}
            {% for number,page in pager.pages %}
                {% set item = {'url': page, 'content': number} %}
                {% set active = number == pager.currentPage %}
                {{ block('page_link') }}
            {% endfor %}
            {{ block('page_next') }}
            {{ block('page_last') }}

    {% endif %}
{% endmacro %}
```

Using the macro 'pager' in a template with the view ('pagerfanta') is easy:

```
{% import 'MyLayoutTemplatesBundle:Navigation:pager.html.twig' as pager %}

...

{{ pager.pager(pagerfanta) }}
```

License
-------

[](#license)

This bundle is released under the MIT license. See the complete license in the bundle:

```
LICENSE

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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.

###  Release Activity

Cadence

Every ~122 days

Total

2

Last Release

3885d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5bc2550764525d2f8aa0c91f41ff065832e60766c030fae572d3ecba271424d9?d=identicon)[Danny Dörfel](/maintainers/Danny%20D%C3%B6rfel)

---

Top Contributors

[![dannydorfel](https://avatars.githubusercontent.com/u/432109?v=4)](https://github.com/dannydorfel "dannydorfel (3 commits)")

### Embed Badge

![Health badge](/badges/swoopaholic-pagerfanta-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/swoopaholic-pagerfanta-bridge/health.svg)](https://phpackages.com/packages/swoopaholic-pagerfanta-bridge)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[friendsofsymfony/elastica-bundle

Elasticsearch PHP integration for your Symfony project using Elastica

1.3k17.2M47](/packages/friendsofsymfony-elastica-bundle)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[ezsystems/ezpublish-kernel

Kernel used by ezsystems/ezplatform and derivatives. Provides the Content Repository, its APIs, and the application's Symfony framework integration.

163579.5k141](/packages/ezsystems-ezpublish-kernel)[netgen/tagsbundle

Netgen Tags Bundle is an Ibexa DXP bundle for taxonomy management and easier classification of content, providing more functionality for tagging content than ibexa\_keyword field type included in Ibexa core.

49456.8k21](/packages/netgen-tagsbundle)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)

PHPackages © 2026

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