1、内核更新

2、bug修复
This commit is contained in:
2016-07-14 15:50:24 +08:00
parent 4b72704c77
commit 7ece5519ae
12 changed files with 204 additions and 182 deletions

View File

@@ -45,7 +45,7 @@ abstract class Paginator
'fragment' => ''
];
public function __construct($items, $listRows, $currentPage = null, $simple = false, $total = null, $options = [])
protected function __construct($items, $listRows, $currentPage = null, $total = null, $simple = false, $options = [])
{
$this->options = array_merge($this->options, $options);
@@ -71,12 +71,21 @@ abstract class Paginator
$this->items = PaginatorCollection::make($items, $this);
}
public function items()
/**
* @param $items
* @param $listRows
* @param null $currentPage
* @param bool $simple
* @param null $total
* @param array $options
* @return PaginatorCollection
*/
public static function make($items, $listRows, $currentPage = null, $total = null, $simple = false, $options = [])
{
return $this->items;
$paginator = new static($items, $listRows, $currentPage, $total, $simple, $options);
return $paginator->items;
}
protected function setCurrentPage($currentPage)
{
if (!$this->simple && $currentPage > $this->lastPage) {