Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chiliec/yii2-pager
Previous and next link for pagination (circular links)
https://github.com/chiliec/yii2-pager
Last synced: about 1 month ago
JSON representation
Previous and next link for pagination (circular links)
- Host: GitHub
- URL: https://github.com/chiliec/yii2-pager
- Owner: chiliec
- License: bsd-3-clause
- Created: 2015-01-01T19:15:41.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-03T07:00:07.000Z (almost 10 years ago)
- Last Synced: 2024-06-02T20:03:00.042Z (6 months ago)
- Language: PHP
- Homepage:
- Size: 146 KB
- Stars: 6
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Pager Widget for Yii 2
======================[![Latest Stable Version](https://poser.pugx.org/chiliec/yii2-pager/v/stable.svg)](https://packagist.org/packages/chiliec/yii2-pager) [![Total Downloads](https://poser.pugx.org/chiliec/yii2-pager/downloads.svg)](https://packagist.org/packages/chiliec/yii2-pager) [![Latest Unstable Version](https://poser.pugx.org/chiliec/yii2-pager/v/unstable.svg)](https://packagist.org/packages/chiliec/yii2-pager) [![License](https://poser.pugx.org/chiliec/yii2-pager/license.svg)](https://packagist.org/packages/chiliec/yii2-pager)
Quick previous and next links for simple pagination implementations with light markup and styles. It's great for simple sites like blogs or magazines. Based on [Bootstrap Pager](http://getbootstrap.com/components/#pagination-pager).
Usage
-----```php
$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'],
]);
?>
```Installation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
php composer.phar require --prefer-dist chiliec/yii2-pager "~2.0"
```or add
```
"chiliec/yii2-pager": "~2.0"
```to the require section of your `composer.json` file.