2017 © Pedro Peláez
 

yii2-extension yii2-pagesizepager

Perpager extension for Yii 2 framework

image

yiicod/yii2-pagesizepager

Perpager extension for Yii 2 framework

  • Sunday, February 18, 2018
  • by lexxorlov
  • Repository
  • 1 Watchers
  • 4 Stars
  • 475 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 40 % Grown

The README.md

Yii widget provides saving grid page size

Provides functionality to add page size pager for any grid and save chosen value in file storage. This is liyunfang\yii2-widget-linkpager fork., (*1)

Latest Stable Version Total Downloads Scrutinizer Code QualityCode Climate, (*2)

Usage

You can choose exists provider: - FileProvider - MongoProvider (You should have https://github.com/yiisoft/yii2-mongodb) - Or you can write your self provider and configute di container, (*3)

'container' => [
    'singletons' => [
        \yiicod\pagesizepager\providers\ProviderInterface::class => [
            'class' => \yiicod\pagesizepager\providers\MongoProvider::class
        ]
    ],
],

Add for any grid, (*4)

echo \yii\grid\GridView::widget([
    'id' => 'uniqueGridId',
    'dataProvider' => $dataProvider,
    'filterSelector' => yiicod\perpager\widgets\PageSizePager::getFilterSelector($dataProvider),
    'pager' => [
        'class' => yiicod\perpager\widgets\PageSizePager::class,
        'gridIdentifier' => 'uniqueGridId',
    ]
]);

Then add in data provider pagination section (for chosen grid), (*5)

$dataProvider = new ActiveDataProvider([
    'query' => $query,
    'pagination' =>  [
        'pageSize' => \Yii::$container->get(\yiicod\pagesizepager\providers\ProviderInterface::class)->getPageSize('uniqueGridId'),
    ],
]);

Note: 'uniqueGridId' must be the same in all places to correct save grid page size, (*6)

The Versions

18/02 2018

dev-master

9999999-dev

Perpager extension for Yii 2 framework

  Sources   Download

MIT New BSD License

The Requires

 

The Development Requires

18/02 2018

1.0.1

1.0.1.0

Perpager extension for Yii 2 framework

  Sources   Download

MIT

The Requires

 

The Development Requires

25/08 2017

1.0

1.0.0.0

Perpager extension for Yii 2 framework

  Sources   Download

New BSD License

The Requires