Skip to content

heartshare/yii2-widget-linkpager

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

yii2-widget-linkpager

LinkPager widgets for Yii Framework 2.0

Increase the pageSize of the page drop-down box Effect picture 1

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='per-page']",
    'pager' => [
        'class' => \liyunfang\pager\LinkPager::className(),
        'showPageSize' => true,
        'dropDownPosition' => \liyunfang\pager\LinkPager::POSITION_RIGHT,
        'pageSizeList' => [10,20],
    ],

ModelSearch

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

该扩展为gird的分页栏提供了页大小下拉框,可以显示在分页按钮的左边和右边两个位置

About

LinkPager widgets for Yii Framework 2.0

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%