PHP code example of liyunfang / yii2-widget-linkpager

1. Go to this page and download the library: Download liyunfang/yii2-widget-linkpager 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/ */

    

liyunfang / yii2-widget-linkpager example snippets


    '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],
        //'pageSizeMargin' => 'margin-left:5px;margin-right:5px;',
        //'pageSizeOptions' => ['class' => 'form-control','style' => 'display: inline-block;width:auto;margin-top:0px;'];
        //'customPageWidth' => 50,
        //'customPageBefore' => ' Jump to ',
        //'customPageAfter' => ' Page ',
        //'customPageMargin' => 'margin-left:5px;margin-right:5px;',
        //'customPageOptions' => ['class' => 'form-control','style' => 'display: inline-block;margin-top:0px;'];
    ],
 

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