Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pgyf/yii2-widget-linkpager
LinkPager widgets for Yii Framework 2.0
https://github.com/pgyf/yii2-widget-linkpager
Last synced: 10 days ago
JSON representation
LinkPager widgets for Yii Framework 2.0
- Host: GitHub
- URL: https://github.com/pgyf/yii2-widget-linkpager
- Owner: pgyf
- Created: 2015-08-27T05:36:00.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-12T06:20:00.000Z (about 7 years ago)
- Last Synced: 2024-05-20T03:20:05.702Z (6 months ago)
- Language: PHP
- Size: 10.7 KB
- Stars: 44
- Watchers: 9
- Forks: 29
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-yii2 - yii2-widget-linkpager
README
# yii2-widget-linkpager
LinkPager widgets for Yii Framework 2.0
===============================
Increase the pageSize of the page drop-down box
![Effect picture 1](https://github.com/liyunfang/wr/blob/master/images/yii2-widget-linkpager-1.png "Effect picture 1")
![Effect picture 2](https://github.com/liyunfang/wr/blob/master/images/yii2-widget-linkpager-2.png "Effect picture 2")Installation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
composer require --prefer-dist liyunfang/yii2-widget-linkpager
```or add
```
"liyunfang/yii2-widget-linkpager": "*"
```to the require section of your `composer.json` file.
Requirements
------------
This extension require twitter-bootstrapUsage
-----Once the extension is installed, simply use it in your code by :
GridView options
```php
'filterSelector' => "select[name='".$dataProvider->getPagination()->pageSizeParam."'],input[name='".$dataProvider->getPagination()->pageParam."']",
'pager' => [
'class' => \liyunfang\pager\LinkPager::className(),
//'template' => '{pageButtons} {customPage} {pageSize}',
//'pageSizeList' => [10, 20, 30, 50],
//'pageSizeMargin' => 'margin-left:5px;margin-right:5px;',
//'pageSizeOptions' => ['class' => 'form-control','style' => 'display: inline-block;width:auto;margin-top:0px;'];
//'customPageWidth' => 50,
//'customPageBefore' => ' Jump to ',
//'customPageAfter' => ' Page ',
//'customPageMargin' => 'margin-left:5px;margin-right:5px;',
//'customPageOptions' => ['class' => 'form-control','style' => 'display: inline-block;margin-top:0px;'];
],
```
ModelSearch
```php
public function search($params)
{
...
$pageSize = isset($params['per-page']) ? intval($params['per-page']) : 10;
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => ['pageSize' => $pageSize,],
]);
```
2015-09-16 重构代码,增加自定义跳转页面文本框