PHPackages                             nirvana-msu/yii2-infinite-scroll - 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. nirvana-msu/yii2-infinite-scroll

AbandonedArchivedYii2-extension[Utility &amp; Helpers](/categories/utility)

nirvana-msu/yii2-infinite-scroll
================================

Yii2 extension for infinite-scroll jQuery plugin

3270.3k↓36.7%19[5 issues](https://github.com/nirvana-msu/yii2-infinite-scroll/issues)[1 PRs](https://github.com/nirvana-msu/yii2-infinite-scroll/pulls)PHP

Since Jul 17Pushed 7y ago6 watchersCompare

[ Source](https://github.com/nirvana-msu/yii2-infinite-scroll)[ Packagist](https://packagist.org/packages/nirvana-msu/yii2-infinite-scroll)[ RSS](/packages/nirvana-msu-yii2-infinite-scroll/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-infinite-scroll
====================

[](#yii2-infinite-scroll)

Yii2 extension for infinite-scroll jQuery plugin, providing scrolling functionality for widgets such as `ListView`. It renders a hyperlink that leads to subsequent page of a target and registers infinite-scroll jQuery plugin which uses javascript to fetch and append content for subsequent pages, gracefully degrading to complete page reload when javascript is disabled.

Several behaviours allowing to customize scroll behavior are provided out of the box, including twitter-style manual trigger, local scroll in overflow div, masonry integration and others.

At the moment this extention only supports v2.x of infinite-scroll plugin.

Resources
---------

[](#resources)

- Yii2 [extension page](http://www.yiiframework.com/extension/yii2-infinite-scroll)
- Infinite-Scroll jQuery plugin [documentation](https://github.com/paulirish/infinite-scroll)

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

[](#installation)

### Composer

[](#composer)

Add extension to your `composer.json` and update your dependencies as usual, e.g. by running `composer update`

```
{
    "require": {
        "nirvana-msu/yii2-infinite-scroll": "1.0.*@dev"
    }
}
```

Widget Configuration
--------------------

[](#widget-configuration)

In addition to most of the properties that `LinkPager` provides, this widget also allows you to configure:

- $widgetId *string* owner widget id, required
- $itemsCssClass *string* CSS class of a tag that encapsulates items, required
- $pluginOptions *array* infinite-scroll jQuery plugin options. For more information refer to infinite-scroll [documentation](https://github.com/paulirish/infinite-scroll)
- $contentLoadedCallback *string|JsExpression* javascript callback to be executed on loading the content via ajax call

Sample Usage
------------

[](#sample-usage)

Plugin works by appending fetched items to the end of parent container, so it is required to configure `layout` property of parent `ListView` widget, wrapping `{items}` into e.g. `div` container with some class (to be used as a selector). It is possible to configure all selectors that widget initializes plugin with to fit your project requirements, but it general it is enough to set `itemCssClass` (class of that wrapping tag that we created) and `widgetId` (which would ensure multiple plugins on the same page would not conflict).

So the minimal required configuration would look like this:

```
echo ListView::widget([
    ...
    'id' => 'my-listview-id',
    'layout' => "{summary}\n{items}\n{pager}",
    'pager' => [
        'class' => InfiniteScrollPager::className(),
        'widgetId' => 'my-listview-id',
        'itemsCssClass' => 'items',
    ],
]);
```

An example illustrating how to customize some widget / plugin options:

```
echo ListView::widget([
    ...
    'id' => 'my-listview-id',
    'layout' => "{summary}\n{items}\n{pager}",
    'pager' => [
        'class' => InfiniteScrollPager::className(),
        'widgetId' => 'my-listview-id',
        'itemsCssClass' => 'items',
        'contentLoadedCallback' => 'afterAjaxListViewUpdate',
        'nextPageLabel' => 'Load more items',
        'linkOptions' => [
            'class' => 'btn btn-lg btn-block',
        ],
        'pluginOptions' => [
            'loading' => [
                'msgText' => "Loading next set of items...",
                'finishedMsg' => "No more items to load",
            ],
            'behavior' => InfiniteScrollPager::BEHAVIOR_TWITTER,
        ],
    ],
]);
```

License
-------

[](#license)

Extension is released under MIT license, same as underlying jQuery plugin.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.6% 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/a1a5dd972c2dcc6866be80df680b326649a14e85dd1586af5a8fbf46e9471d0c?d=identicon)[nirvana-msu](/maintainers/nirvana-msu)

---

Top Contributors

[![nirvana-msu](https://avatars.githubusercontent.com/u/5787387?v=4)](https://github.com/nirvana-msu "nirvana-msu (11 commits)")[![dmitry-kulikov](https://avatars.githubusercontent.com/u/3766212?v=4)](https://github.com/dmitry-kulikov "dmitry-kulikov (2 commits)")[![gbespyatykh](https://avatars.githubusercontent.com/u/5813183?v=4)](https://github.com/gbespyatykh "gbespyatykh (1 commits)")

---

Tags

infinite-scroll-pluginphpyii2-extension

### Embed Badge

![Health badge](/badges/nirvana-msu-yii2-infinite-scroll/health.svg)

```
[![Health](https://phpackages.com/badges/nirvana-msu-yii2-infinite-scroll/health.svg)](https://phpackages.com/packages/nirvana-msu-yii2-infinite-scroll)
```

###  Alternatives

[elfsundae/laravel-hashid

A simple, elegant way to obfuscate your data by generating reversible, non-sequential, URL-safe identifiers.

415246.3k2](/packages/elfsundae-laravel-hashid)[tapp/laravel-aws-secrets-manager

Use AWS Secrets manager to load environment variables for configuration.

37208.6k](/packages/tapp-laravel-aws-secrets-manager)

PHPackages © 2026

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