LinkPager.php 881 Bytes
<?php


namespace backend\widgets;

use yii\widgets\LinkPager as yiiLinkPager;

class LinkPager extends yiiLinkPager
{
    
    /**
     * Renders the page buttons.
     * @return string the rendering result
     */
    protected function renderPageButtons()
    {
        $pageCount = $this->pagination->getPageCount();
        if ($pageCount < 2 && $this->hideOnSinglePage) {
            return '';
        }

        $currentPage = $this->pagination->getPage();

        return $this->render('pagination/yoho',[
            'total_pages'=>$pageCount,
            'current_first_item'=>$this->pagination->getOffset()+1,
            'current_last_item'=>$this->pagination->getOffset()+$this->pagination->getPageSize(),
            'total_items'=>$this->pagination->totalCount,
            'current_page'=>$currentPage+1,
            'page'=>$this->pagination,
        ]);
    }
}