Merge pull request #492 from hedeqiang/master

Update paginator.md
This commit is contained in:
黄朝晖 2019-09-01 16:16:50 +08:00 committed by GitHub
commit e1850a5ca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,7 @@ if ($paginator->hasMorePages()) {
}
```
## 获取上一页和下一页的 URL
## 获取对应分页的 URL
```php
<?php
@ -89,12 +89,34 @@ if ($paginator->hasMorePages()) {
$nextPageUrl = $paginator->nextPageUrl();
// 上一页的 URL
$previousPageUrl = $paginator->previousPageUrl();
// 获取指定 $page 页数的 URL
$url = $paginator->url($page);
```
## 获取指定页数的 URL
## 是否处于第一页
```php
<?php
// 获取指定 $page 页数的 URL
$url = $paginator->url($page);
```
$onFirstPage = $paginator->onFirstPage();
```
## 是否有更多分页
```php
<?php
$hasMorePages = $paginator->hasMorePages();
```
## 每页的数据条数
```php
<?php
$perPage = $paginator->perPage();
```
## 数据总数
```php
<?php
$total = $paginator->total();
```