Yii2 LinkPager displays a few pages before and after the current page and first and last pages, (*1)
, (*2)
Installation
Install the extension
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
php composer.phar require --prefer-dist maddog043/yii2-separatedpager "*"
or add, (*5)
"maddog043/yii2-separatedpager": "*"
to the require section of your composer.json
file., (*6)
Usage
Simply add the LinkPager
to page, (*7)
use maddog043\separatedpager\LinkPager;
...
LinkPager::widget([
'pagination' => $pages,
'maxButtonCount' => 1,
]);
$pages
is yii\data\Pagination, (*8)
maxButtonCount
is count button before and after the current page, (*9)
separator
is separator for pages, (*10)
separatorClass
is class for separator symbol, (*11)