承接 nterms/yii2-pagesize-widget 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nterms/yii2-pagesize-widget

最新稳定版本:v2.0.1

Composer 安装命令:

composer require nterms/yii2-pagesize-widget

包简介

Widget for enabling dynamic page size selection on GridView

README 文档

README

PageSize widget is an extension to the Yii2 GridView that enables changing the size of a page on GridView.

Latest Stable Version Total Downloads Latest Unstable Version License

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist nterms/yii2-pagesize-widget "*"

or add

"nterms/yii2-pagesize-widget": "*"

to the require section of your composer.json file.

Usage

To use this widget with a GridView, add this widget to the view where the GridView is:

<?php echo \nterms\pagesize\PageSize::widget(); ?>

and set the filterSelector property of GridView as shown in following example.

<?= GridView::widget([
     'dataProvider' => $dataProvider,
     'filterModel' => $searchModel,
		'filterSelector' => 'select[name="per-page"]',
     'columns' => [
         ...
     ],
 ]); ?>

Please note that per-page here is the string you use for pageSizeParam setting of the PageSize widget.

Configurations

Following properties are available for customizing the widget.

  • label: Text for the lbel
  • defaultPageSize: This value will be used if there's no page size selected
  • pageSizeParam: The name of the page size parameter used for the pagination widget in your grid view
  • sizes: An array of key values to be used as page sizes. Both kay and value should be integers
  • template: A template string to be used for rendering the elements. Default is '{list} {label}'
  • options: HTML attributes for the <select> element
  • labelOptions: HTML attributes for the <label> element
  • encodeLabel: Whether to encode label text

License

MIT

统计信息

  • 总下载量: 288.02k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 39
  • 点击次数: 1
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 38
  • Watchers: 8
  • Forks: 18
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-08-08