1. Go to this page and download the library: Download chiliec/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/ */
chiliec / yii2-pager example snippets
echo \chiliec\pager\Pager::widget([
'tableName' => $model->tableName(),
'currentId' => $model->id, // current primary key
'path' => 'story/view', // path for link
// optional fields in most cases
'primaryKey' => 'id', // name of primary key column
'title' => 'title', // name of title column
'additionalСondition' => 'published = 1', // additional SQL-condition
'cacheTime' => 3600, // time for cache results
'navOptions' => [],
'listOptions' => ['class' => 'pager'],
'prevOptions' => ['class' => 'pull-left', 'rel' => 'prev'],
'nextOptions' => ['class' => 'pull-right', 'rel' => 'next'],
]);
php composer.phar
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.