yii2-widget-linkpager LinkPager widgets for Yii Framework 2.0

yii2-widget-linkpager

  1. Installation
  2. Requirements
  3. Usage
  4. Resources

LinkPager widgets for Yii Framework 2.0

Increase the pageSize of the page drop-down box pic pic

Installation

The preferred way to install this extension is through composer.

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-bootstrap

Usage

Once the extension is installed, simply use it in your code by :

GridView options

'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],
        //'customPageWidth' => 50,
        //'customPageBefore' => ' Jump to ',
        //'customPageAfter' => ' Page ',
    ],

ModelSearch

public function search($params)
    {
        ...
        $pageSize = isset($params['per-page']) ? intval($params['per-page']) : 10;
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' =>  ['pageSize' => $pageSize,],
        ]);
        

Resources

github: https://github.com/liyunfang/yii2-widget-linkpager

2015-09-16 重构代码,增加自定义跳转页面文本框

0 0
1 follower
0 downloads
Yii Version: 2.0
License: BSD-2-Clause
Category: User Interface
Developed by: liyunfang
Created on: Sep 7, 2015
Last updated: 8 years ago

Downloads

show all

Related Extensions