@param int $size
@param int $page

@return \ManaPHP\Paginator
496791
public function paginate($size = null, $page = null)
    {
        $this->page($size, $page);

        $items = $this->fetch(true);

        if ($this->_limit === null) {
            $count = count($items);
        } elseif (count($items) % $this->_limit === 0) {
            $count = $this->count();
        } else {
            $count = $this->_offset + count($items);
        }

        $paginator = $this->paginator;

        $paginator->items = $items;

        return $paginator->paginate($count, $this->_limit, (int)($this->_offset / $this->_limit) + 1);
    }
391414
public function listData($list, $page = 1, $size = 10)
    {
        $reData['totalPages'] = (int)$list->lastPage();
        $reData['totalCount'] = (int)$list->total();
        $reData['page'] = (int)$page;
        $reData['limit'] = (int)$size;
        $reData['count'] = (int)$list->count();

        if ($page == 1) {
            $reData['firstPage'] = true; //是否为首页
            $reData['hasPrePage'] = false; //是否有上一页
            $reData['prePage'] = 0; //上一页的页数
            if ($reData['totalPages'] == 1) {
                $reData['hasNextPage'] = false; //是否有下一页
                $reData['nextPage'] = 0;
            } else {
                $reData['hasNextPage'] = true; //是否有下一页
                $reData['nextPage'] = 2; //下一页的页数
            }
        } else {
            $reData['firstPage'] = false; //是否为首页
            if ($reData['totalPages'] == 1) {
                $reData['hasPrePage'] = false; //是否有上一页
                $reData['hasNextPage'] = false; //是否有下一页
                $reData['prePage'] = 1; //上一页的页数
                $reData['nextPage'] = 0; //下一页的页数
            } elseif ($page < $reData['totalPages']) {
                $reData['hasPrePage'] = true; //是否有上一页
                $reData['hasNextPage'] = true; //是否有下一页
                $reData['prePage'] = $page - 1; //上一页的页数
                $reData['nextPage'] = $page + 1; //下一页的页数
            } else {
                $reData['hasPrePage'] = true; //是否有上一页
                $reData['hasNextPage'] = false; //是否有下一页
                $reData['prePage'] = $page - 1; //上一页的页数
                $reData['nextPage'] = 0; //下一页的页数
            }
        }

        if ($page == $reData['totalPages']) {
            $reData['lastPage'] = true; //是否是最末页
        } else {
            $reData['lastPage'] = false; //是否是最末页
        }

        $reData['data'] = $list->toArray()['data'];

        return $reData;
    }
613018
public function paginate($perPage, $columns, $pageName, $page)
    {
        $total = $this->db->count();

        $page = $page ?: Paginator::resolveCurrentPage($pageName);

        $results = $this->db->forPage($page, $per_page);

        return new LengthAwarePaginator($results, $total, $per_page, $page, [
            'path'     => Paginator::resolveCurrentPath(),
            'pageName' => $pageName,
        ]);
    }
1225562
public function paginate($perPage = 20)
    {
        $page = request()->get('page', 1);
        $path = request()->url();

        return new LengthAwarePaginator(
            $this->forPage($page, $perPage),
            $this->count(),
            $perPage,
            $page,
            compact('path')
        );
    }
11338
public function paginate(Builder $builder, $perPage, $page)
    {
        $result = $this->performSearch($builder, [
            'numericFilters' => $this->filters($builder),
            'from' => (($page * $perPage) - $perPage),
            'size' => $perPage,
        ]);

       $result['nbPages'] = $result['hits']['total']/$perPage;

        return $result;
    }
1279454
public function limit($page, $length)
    {
        //argument test
        Argument::i()
            //Argument 1 must be a number
            ->test(1, 'numeric')
            //Argument 2 must be a number
            ->test(2, 'numeric');
        
        $this->page = $page;
        $this->length = $length;

        return $this;
    }
1131124
public function page($page, $size) {
        if ( $page <= 0 ) $page = 1;
        $offset = ($page-1) * $size;
        return $this->offset($offset, $size);
    }
625441
public function setPageSize($size)
    {
        $this->pageSize = ($size === null ? self::PAGE_SIZE : (int)$size);
        if ($this->pageSize < 0)
            $this->pageSize = self::PAGE_SIZE;

        return $this;
    }
196247
public function paginate($page, $itemsOnPage = 30)
    {
        $paginator = new Paginator($this);
        return $paginator
            ->setCurrentPage($page)
            ->setItemsOnPage($itemsOnPage);
    }
1360444
private function setPage($page, $pageSize)
    {
        $this->subscriptionCollection
            ->setCurPage($page)
            ->setPageSize($pageSize);
        return $this;
    }
191931
public static <E> Page<E> startPage(int pageNum, int pageSize) {
        return startPage(pageNum, pageSize, DEFAULT_COUNT);
    }
1126290
static public function paginate($page, $per_page)
    {
        $query = self::createRelation();
        return $query->paginate($page, $per_page);
    }
136573
public function setFontSize(int $size): PdfInterface
    {
        $this->fontSize = (int) $size;
        $this->mpdf->SetDefaultFontSize($this->fontSize);

        return $this;
    }
11577
public function page($pageNo = null, $size = 20) {
        if ($pageNo === null) {
            $pageNo = irqst('pager.page', 1);
            $size   = irqst('pager.size', 20);
        }
        $pageNo = intval($pageNo);
        if ($pageNo <= 0) {
            $pageNo = 1;
        }

        return $this->limit(($pageNo - 1) * $size, $size);
    }
360854
public function setSize(WebDriverDimension $size)
    {
        $params = [
            'width' => $size->getWidth(),
            'height' => $size->getHeight(),
            ':windowHandle' => 'current',
        ];
        $this->executor->execute(DriverCommand::SET_WINDOW_SIZE, $params);

        return $this;
    }
85396
public function setSize($size) {
		$this->owner->ButtonSize = trim(strtolower($size));
		return $this->owner;
	}
163905
private function createPaginator(AdapterInterface $adapter, $page, $count)
    {
        $pager = new Pagerfanta($adapter);

        try {
            $pager->setMaxPerPage($count)->setCurrentPage($page);
        } catch (NotValidCurrentPageException $e) {
            // Do nothing, because we don't care ...
        }

        return new PagerfantaPaginatorAdapter($pager, function ($page) {
            return "page={$page}";
        });
    }