2017 © Pedro Peláez
 

cakephp-plugin flexlimitpagination

Flexpager plugin for CakePHP

image

fusic/flexlimitpagination

Flexpager plugin for CakePHP

  • Wednesday, April 5, 2017
  • by fusic
  • Repository
  • 2 Watchers
  • 0 Stars
  • 61 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 3 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

Flexpager plugin for CakePHP

maintainer: @gorogoroyasu, (*1)

Installation

composer require fusic/Flexpager

discription

this plugin will help you to create the candidates of pagination. ex), (*2)

normal paginator, (*3)

< prev  1 2 3 4 5 next >

this paginator, (*4)

< 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., (*5)

settings

first of all, you have to load the component. and, you have to write "listCandidates" in public $paginate, (*6)

in controller, (*7)


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, (*8)

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

usage

in controller (for example in index ), (*9)

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

in ctp (for example in index), (*10)

<?= $this->Flexpaginator->prev('< '.__('previous')) ?>
<?= $this->Flexpaginator->numbers() ?>
<?= $this->Flexpaginator->next(__('next').' >') ?>
<?= $this->Flexpaginator->limitCandidate() ?>

the method limitCandidate() will return the list of candidates., (*11)

if you want to customize the template, you can use the method below., (*12)

<?= $this->Flexpaginator->setFlexPagerTemplate('<a class="form-control" href={{url}}>{{content}}</a>') ?>

the args of this method have to include '{{url}}' and '{{content}}'., (*13)

the default template is '<a href={{url}}>{{content}}</a>'., (*14)

please note that setFlexPagerTemplate method should appear before the method listCandidates., (*15)

The Versions

05/04 2017

dev-master

9999999-dev

Flexpager plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires

04/04 2017

0.3.3

0.3.3.0

Flexpager plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires

03/04 2017

0.3.2

0.3.2.0

Flexpager plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires

27/03 2017

0.3.1

0.3.1.0

Flexpager plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires

27/03 2017

dev-gorogoroyasu-patch-1

dev-gorogoroyasu-patch-1

Flexpager plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires

17/03 2017

0.3.0

0.3.0.0

Flexpager plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires

02/03 2017

0.2.0

0.2.0.0

Flexpager plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires

02/03 2017

0.1.4

0.1.4.0

Flexpager plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires

01/02 2017

0.1.3

0.1.3.0

Flexpager plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires

23/01 2017

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1

Flexpager plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires

25/12 2016

0.1.2

0.1.2.0

Flexpager plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires

25/12 2016

0.1.1

0.1.1.0

Flexpager plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires

13/12 2016

0.1.0

0.1.0.0

Flexpager plugin for CakePHP

  Sources   Download

The Requires

 

The Development Requires