PHP code example of exploitfate / yii2-pager

1. Go to this page and download the library: Download exploitfate/yii2-pager library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

exploitfate / yii2-pager example snippets



// Override default parameters for \yii\data\Pagination
\Yii::$container->set(
    \yii\data\Pagination::className(),
    [
        'pageSizeLimit' => [1, 1000],
        'defaultPageSize' => 200,
    ]
);



echo \yii\grid\GridView::widget(
    [
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'pager' => [
            'class' => \exploitfate\yii2\LinkPager::className(),
        ],
        
        // other settings
        
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],
    
            // other collumns
        ],
    ]
);


// Override default parameters for \yii\grid\GridView
\Yii::$container->set(
    \yii\grid\GridView::className(),
    [
        'pager' => [
            'class' => \exploitfate\yii2\LinkPager::className(),
        ],
     ]
);



// Override default parameters for \yii\grid\ListView
\Yii::$container->set(
    \yii\grid\ListView::className(),
     [
        'pager' => [
            'class' => \exploitfate\yii2\LinkPager::className(),
        ],
     ]
);



echo \exploitfate\yii2\LinkPager::widget(
    [
        'pagination' => $dataProvider->getPagination(),
    ]
);