PHPackages                             pcrt/yii2-ajax-pager - 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. pcrt/yii2-ajax-pager

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

pcrt/yii2-ajax-pager
====================

Yii2-select2 widget implementation

1.0.31(4y ago)01.1k↓50%1BSD-3-ClauseJavaScript

Since Feb 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/pcrt/yii2-ajax-pager)[ Packagist](https://packagist.org/packages/pcrt/yii2-ajax-pager)[ RSS](/packages/pcrt-yii2-ajax-pager/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)DependenciesVersions (25)Used By (1)

Yii2-Ajax-Pager
===============

[](#yii2-ajax-pager)

Yii2 Component extend yii\\widgets\\ContentDecorator [url](https://www.yiiframework.com/doc/api/2.0/yii-widgets-contentdecorator) used to add ajax-pagination functionality to GridView and ListView base component .

This extension create a Wrapper around content and permit to chose between "Paginator Pattern" or "InfiniteScroll Pattern" to manage pagination functionality without reload page .

\##Installation

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ php composer.phar require pcrt/yii2-ajax-pager "@dev"

```

or add

```
"pcrt/yii2-ajax-pager": "@dev"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, you can add component in your View: The component can work as Pagination :

```
use pcrt/Paginator;
....

$this->renderPartial('ajax/list', [ 'dt' => $dataProvider ]);
// or do your magic here !

```

or in InfiniteScroll mode:

```
use pcrt/Paginator;
....

$this->renderPartial('ajax/_card', [ 'dt' => $dataProvider ]);
// or do your magic here !

```

You can also pass an alternative "wapper view" file :

```
use pcrt/Paginator;
....

// Remenber to return $content variable inside of wrapper;
```

In the controller for InfiniteScroll return a renderAjax file:

```
class MyController extends Controller {

  public function actionGetGridView(){

    public function actionGetGridView($pageNumber=0,$pageSize=50){
      if($pageSize == ""){
        $pageSize = 50;
      }
      $request = \Yii::$app->request;

      $searchModel = new MyControllerSearch();
      $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
      $dataProvider->pagination = [
              'pageSize'=>$pageSize,
              'page'=>$pageNumber-1,
      ];
      $result = $dataProvider->getTotalCount();
      $data = $this->renderAjax('_list', [
          'searchModel' => $searchModel,
          'dataProvider' => $dataProvider,
      ]);
      return $data;

  	}
	}

}
```

for Pagination return a jSON Object with data (html render) and total (total number of element):

```
class MyController extends Controller {

  public function actionGetGridView($pageNumber=0,$pageSize=50){
    \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
    if($pageSize == ""){
      $pageSize = 50;
    }
    $request = \Yii::$app->request;

    $searchModel = new MyControllerSearch();
    $dataProvider = $searchModel->search();
    $dataProvider->pagination = [
            'pageSize'=>$pageSize,
            'page'=>$pageNumber-1,
    ];
    $result = $dataProvider->getTotalCount();
    $data = $this->renderAjax('_list', [
        'searchModel' => $searchModel,
        'dataProvider' => $dataProvider,
    ]);
    return ['html'=>$data,'total'=>$result];
	}
}
```

License
-------

[](#license)

Yii2-Ajax-Pager is released under the BSD-3 License. See the bundled `LICENSE.md` for details.

Useful URLs
===========

[](#useful-urls)

- [Simple Pagination JS](http://flaviusmatis.github.io/simplePagination.js/)
- [Infinite Scroll JS](https://infinite-scroll.com/)

Enjoy!

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 60.4% 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 ~38 days

Recently: every ~10 days

Total

24

Last Release

1811d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f6ad6343f484e9e2ee1c530ec7c4067ad974f540cff580dce786b8953f3fdd1?d=identicon)[protocolli](/maintainers/protocolli)

---

Top Contributors

[![pcrt](https://avatars.githubusercontent.com/u/44270932?v=4)](https://github.com/pcrt "pcrt (29 commits)")[![fr00ller](https://avatars.githubusercontent.com/u/722758?v=4)](https://github.com/fr00ller "fr00ller (19 commits)")

---

Tags

helperyii2themeassetsselect2

### Embed Badge

![Health badge](/badges/pcrt-yii2-ajax-pager/health.svg)

```
[![Health](https://phpackages.com/badges/pcrt-yii2-ajax-pager/health.svg)](https://phpackages.com/packages/pcrt-yii2-ajax-pager)
```

###  Alternatives

[ttskch/select2-bootstrap4-theme

Select2 v4 theme for Bootstrap4

43525.7k2](/packages/ttskch-select2-bootstrap4-theme)

PHPackages © 2026

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