Quantcast
Channel: Live News for Yii Framework
Viewing all articles
Browse latest Browse all 3361

[extension] zhuravljov/yii2-pagination

$
0
0

Yii2 Pagination Widgets

  1. Installation
  2. Usage

Latest Stable Version Total Downloads

Installation

The preferred way to install the extension is through composer. Add to the require section of your composer.json file:

"zhuravljov/yii2-paginations": "~1.0"

Usage

Way to add PageSizer 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],
            ],
        ],
    ],
];

Viewing all articles
Browse latest Browse all 3361

Trending Articles