改进分页类

This commit is contained in:
yunwuxin
2016-07-14 10:44:04 +08:00
parent e57a60f974
commit 30e25f938b
6 changed files with 179 additions and 134 deletions

View File

@@ -23,6 +23,8 @@ use think\Paginator;
* @method string render()
* @method Paginator fragment($fragment)
* @method Paginator appends($key, $value)
* @method integer lastPage()
* @method boolean hasPages()
*/
class Collection extends \think\Collection
{
@@ -40,17 +42,7 @@ class Collection extends \think\Collection
{
return new static($items, $paginator);
}
public function setPaginator(Paginator $paginator)
{
$this->paginator = $paginator;
}
public function getPaginator()
{
return $this->paginator;
}
public function toArray()
{
if ($this->paginator) {