zhuravljov / yii2-pagination
Yii2 Pagination Widgets
Installs: 19 525
Dependents: 4
Suggesters: 4
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.5.0
- yiisoft/yii2: ~2.0.18
Requires (Dev)
- yiisoft/yii2-debug: ~2.1.0
README
Installation
The preferred way to install the extension is through composer.
Add to the require section of your composer.json
file:
"zhuravljov/yii2-pagination": "~1.0"
Usage
Way to add page size widget to each GridView
and ListView
of an application
using DI container definition:
<?php return [ 'container' => [ 'definitions' => [ \yii\widgets\LinkPager::class => \zhuravljov\yii\pagination\LinkPager::class, ], ], ];
Advanced container configuration of LinkPager
and LinkSizer
widgets:
<?php return [ 'container' => [ 'definitions' => [ \yii\widgets\LinkPager::class => \zhuravljov\yii\pagination\LinkPager::class, \zhuravljov\yii\pagination\LinkPager::class => [ 'maxButtonCount' => 5, ], \zhuravljov\yii\pagination\LinkSizer::class => [ 'sizes' => [5, 10, 20, 50, 100], ], \yii\data\Pagination::class => [ 'defaultPageSize' => 10, 'pageSizeLimit' => [1, 100], ], ], ], ];
There is StoredPagination
to store page size that was selected before by user.
DI container definition looks like:
<?php return [ 'container' => [ 'definitions' => [ \yii\data\Pagination::class => \zhuravljov\yii\pagination\StoredPagination::class, ], ], ];
There is StoredSort
to store selected sorting.
DI container definition looks like:
<?php return [ 'container' => [ 'definitions' => [ \yii\data\Sort::class => \zhuravljov\yii\pagination\StoredSort::class, ], ], ];