PHPackages                             surda/items-per-page - 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. [Framework](/categories/framework)
4. /
5. surda/items-per-page

ActiveLibrary[Framework](/categories/framework)

surda/items-per-page
====================

Items per page control for Nette Framework

v2.1.0(3y ago)0591MITPHPPHP &gt;=7.1

Since Mar 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/surda/items-per-page)[ Packagist](https://packagist.org/packages/surda/items-per-page)[ Docs](http://surani.cz)[ RSS](/packages/surda-items-per-page/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (9)Versions (9)Used By (0)

Items per page
==============

[](#items-per-page)

---

[![Build Status](https://camo.githubusercontent.com/bed79300c3e453cd4c239ac0d73bc173832d45c909475a27a8564e1576732cf6/68747470733a2f2f7472617669732d63692e6f72672f73757264612f6974656d732d7065722d706167652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/surda/items-per-page)[![Licence](https://camo.githubusercontent.com/edd17a6ce716bd478d62bdeab83d4b192c1c6d4997546197ac7e854d1ffcf882/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73757264612f6974656d732d7065722d706167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/surda/items-per-page)[![Latest stable](https://camo.githubusercontent.com/f337d7582b30368e92fd6c75b9c611ec16c4f002f2b790758d2e8992363ec1fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73757264612f6974656d732d7065722d706167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/surda/items-per-page)[![PHPStan](https://camo.githubusercontent.com/441b5874ce4df0a2defc892979c96c46889b69cb32119d04f0b48626349f8bc9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/phpstan/phpstan)

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

[](#installation)

The recommended way to is via Composer:

```
composer require surda/items-per-page

```

After that you have to register extension in config.neon:

```
extensions:
    itemsPerPage: Surda\ItemsPerPage\ItemsPerPageExtension
```

Configuration
-------------

[](#configuration)

Default

```
itemsPerPage:
    listOfValues: [20, 50, 100]
    defaultValue: 20
    storageKeyName: ipp
    useAjax: TRUE
    storage: Surda\KeyValueStorage\Session
    templates:
        default: bootstrap4.dropdown.latte
        nav-item: bootstrap4.nav-item.latte
```

Usage
-----

[](#usage)

Presenter

```
use Surda\ItemsPerPage\TItemsPerPage;
use Surda\ItemsPerPage\ItemsPerPageControl;

class ProductPresenter extends Nette\Application\UI\Presenter
{
    use TItemsPerPage;

    public function actionDefault(): void
    {
        /** @var ItemsPerPageControl $ipp */
        $ipp = $this->getComponent('ipp');

        $itemsPerPage = $ipp->getValue();
    }
}
```

Template

```
{control ipp}
```

### Custom

[](#custom)

```
use Surda\ItemsPerPage\ItemsPerPageControl;
use Surda\ItemsPerPage\ItemsPerPageFactory;

class ProductPresenter extends Nette\Application\UI\Presenter
{
    /** @var ItemsPerPageFactory */
    private $itemsPerPageFactory;

    /**
     * @param ItemsPerPageFactory $itemsPerPageFactory
     */
    public function injectItemsPerPageFactory(ItemsPerPageFactory $itemsPerPageFactory): void
    {
        $this->itemsPerPageFactory = $itemsPerPageFactory;
    }

    public function actionDefault(): void
    {
        /** @var ItemsPerPageControl $ipp */
        $ipp = $this->getComponent('ipp');

        $itemsPerPage = $ipp->getValue();
    }

    /**
     * @return ItemsPerPageControl
     */
    protected function createComponentIpp(): ItemsPerPageControl
    {
        // Init items per page component
        $control = $this->itemsPerPageFactory->create();

        // Define event
        $control->onChange[] = function (ItemsPerPageControl $control, int $value): void {
            // ...
        };

        return $control;
    }
}
```

Custom options
--------------

[](#custom-options)

```
class ProductPresenter extends Nette\Application\UI\Presenter
{
    /**
     * @return ItemsPerPageControl
     */
    protected function createComponentIpp(): ItemsPerPageControl
    {
        // Init items per page component
        $control = $this->itemsPerPageFactory->create();

        // list of allowed values
        $control->setListOfValues([20, 50, 100]);

        // Default items per page
        $control->setDefaultValue(20);

        // Value of items per page
        $control->setValue(20);

        // To use your own template
        $control->setTemplateFile('path/to/your/latte/file.latte');

        // Enable ajax (defult is enabled)
        $control->enableAjax();

        // Disable ajax
        $control->disableAjax();

        return $control;
    }
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Recently: every ~303 days

Total

8

Last Release

1286d ago

Major Versions

v1.3.4 → v2.0.02021-03-19

### Community

Maintainers

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

---

Top Contributors

[![surda](https://avatars.githubusercontent.com/u/588663?v=4)](https://github.com/surda "surda (23 commits)")

---

Tags

nettecontrol

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/surda-items-per-page/health.svg)

```
[![Health](https://phpackages.com/badges/surda-items-per-page/health.svg)](https://phpackages.com/packages/surda-items-per-page)
```

###  Alternatives

[nette/application

🏆 Nette Application: a full-stack component-based MVC kernel for PHP that helps you write powerful and modern web applications. Write less, have cleaner code and your work will bring you joy.

44615.4M983](/packages/nette-application)[nette/bootstrap

🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.

68435.8M592](/packages/nette-bootstrap)[contributte/application

Extra contrib to nette/application

352.8M7](/packages/contributte-application)[contributte/webpack

Webpack integration for Nette Framework.

471.0M1](/packages/contributte-webpack)[nette/web-project

Nette: Standard Web Project

10991.8k](/packages/nette-web-project)[kdyby/autowired

Syntax sugar for working with services in Nette Framework

30885.7k9](/packages/kdyby-autowired)

PHPackages © 2026

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