PHPackages                             olegbolden/yii2-show-n-pages - 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. olegbolden/yii2-show-n-pages

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

olegbolden/yii2-show-n-pages
============================

Dropdown page size selector in DataTables-like style

v2.2(2y ago)0302MITPHPPHP &gt;=5.6.0

Since Mar 31Pushed 2y ago1 watchersCompare

[ Source](https://github.com/olegbolden/yii2-show-n-pages)[ Packagist](https://packagist.org/packages/olegbolden/yii2-show-n-pages)[ RSS](/packages/olegbolden-yii2-show-n-pages/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (5)Used By (0)

Page size selector widget (for DetailView, GridView etc.)
=========================================================

[](#page-size-selector-widget-for-detailview-gridview-etc)

By default, there is no page size selector for Yii2 in multiple page listings created with widgets like DetailView etc. This extension adds such a functionality in popular javascript DataTables-like style without jQuery.

The extension is simple to use and fully customizable to fit your page layout.

Compatibility
-------------

[](#compatibility)

```
PHP version >=5.6
All modern browsers and IE.
Yii2 versions >=2.0.*

```

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist olegbolden/yii2-show-n-pages "*"

```

or add

```
"olegbolden/yii2-show-n-pages": "*"

```

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

Usage
-----

[](#usage)

1. First step is to specify actual page size provided by this widget for your data provider

```
$dataProvider = new ActiveDataProvider([
    'query' => $query,
    'pagination' => [
        'pageSize' => PageSizeWidget::getPageSize([
            'section'   => 'statistics',
            'pageSizes' => [25, 50, 100],
        ]),
    ],
]);
```

`'section'` parameter specifies section identifier for the corresponding widget because there are may be several places in your site with different PageSizeWidget instances having their own page settings so widget needs these identifiers to distinguish between them. In case you use the only instance then section identifier can be omitted and defaults to 'main'.

`'pageSizes'` parameter specifies custom set of predefined page sizes in case you are not satisfied with the default one for corresponding data provider. Default is \[10, 25, 50, 100, All\] and can be also omitted. It is useful if you want to exclude option "All" among page sizes in case your data set is very big and there is no sense to show all items on the only page.

2. Now you can insert the Widget in your View code by

```

```

Options
-------

[](#options)

The following arrayed options are available

**lang**

Language settings

```
'lang' => [
    PageSizeWidget::LANG_SHOW    => 'Показать',
    PageSizeWidget::LANG_ENTRIES => 'записей',
    PageSizeWidget::LANG_ALL     => 'Все',
]
```

**section**

Optional parameter to distinguish between widgets for different sections of your site to set independent page size settings for each.

It's important, that each `'section'` specified here MUST have the same `'section'` in corresponding data provider pagination setup described above.

```
'section' => 'statistics'
```

**wrapperClass / innerClass**

Style classes for the widget to fit in your page.

For example, styles specified as

```
'wrapperClass' => 'pull-right',
'innerClass' => 'pageSelector'
```

will give the following layout

```

    Show
            10
            ...
            All
         items

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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 ~427 days

Total

4

Last Release

952d ago

Major Versions

v1.0 → v2.02023-09-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/c817b89afaa0c273ef0f5ab5e0de514b266d2f79e4a4f9bc49ce9a41865ebf3e?d=identicon)[olegbolden](/maintainers/olegbolden)

---

Top Contributors

[![olegbolden](https://avatars.githubusercontent.com/u/18537369?v=4)](https://github.com/olegbolden "olegbolden (9 commits)")

---

Tags

yii2extension

### Embed Badge

![Health badge](/badges/olegbolden-yii2-show-n-pages/health.svg)

```
[![Health](https://phpackages.com/badges/olegbolden-yii2-show-n-pages/health.svg)](https://phpackages.com/packages/olegbolden-yii2-show-n-pages)
```

###  Alternatives

[vyants/yii2-daemon

Extension provides functionality for simple daemons creation and control

7859.0k](/packages/vyants-yii2-daemon)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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