PHPackages                             fusic/flexlimitpagination - 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. fusic/flexlimitpagination

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

fusic/flexlimitpagination
=========================

Flexpager plugin for CakePHP

0.3.3(9y ago)0641[2 issues](https://github.com/fusic/flexlimitpagination/issues)[1 PRs](https://github.com/fusic/flexlimitpagination/pulls)PHPPHP &gt;=5.5.9

Since Dec 13Pushed 9y ago2 watchersCompare

[ Source](https://github.com/fusic/flexlimitpagination)[ Packagist](https://packagist.org/packages/fusic/flexlimitpagination)[ RSS](/packages/fusic-flexlimitpagination/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (2)Versions (13)Used By (0)

Flexpager plugin for CakePHP
============================

[](#flexpager-plugin-for-cakephp)

maintainer: @gorogoroyasu

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

[](#installation)

```
composer require fusic/Flexpager

```

discription
-----------

[](#discription)

this plugin will help you to create the candidates of pagination. ex)

normal paginator

```
< prev  1 2 3 4 5 next >

```

this paginator

```
< prev 1 2 3 4 5 next> 10 20 100

```

the "10","20","100" means that the use of your application can change the paginate limit flexibly.

settings
--------

[](#settings)

first of all, you have to load the component. and, you have to write "listCandidates" in `public $paginate`

in controller

```

public $paginate = [
    'listCandidates' = [10, 20, 100],
    // and more configs.
];
public function initialize()
{
    parent::initialize();
    $this->loadComponent('Flexpager.Flexpager');
}

```

after that, you have to add this line to AppView.php

```
public function initialize()
{
    parent::initialize();
    $this->loadHelper('Flexpager.Flexpaginator');
}

```

usage
-----

[](#usage)

in controller (for example in index )

```
public function index()
{
    $pages = $this->Flexpager->paginate($this->Pages);
    $this->set(compact('pages'));
}

```

in ctp (for example in index)

```

```

the method limitCandidate() will return the list of candidates.

if you want to customize the template, you can use the method below.

```
