Set page and (re)calculate
@param int $page
@return Pagination
@throws Exception
495742
public function setPage(int $page): Pagination
    {
        $this->current_page = $page;
        $this->calculate();
        return $this;
    }
985225
public function setPage($page)
    {
        if ($page > $this->getNumberOfPages() || $page < 1) {
            throw new PageDoesNotExist("Page {$page} does not exist");
        }

        $this->page = $page;

        return $this;
    }
476680
public function getPaginated($page = 1, $limit = 10)
    {
        $query = $this->make();
        $collection = $query->forPage($page, $limit)->get();
        return new PaginatedResult($page, $limit, $collection->count(), $collection);
    }
300815
public function setPage($page)
    {
        if ($page < 1) {
            $page = 1;
        }

        if ($this->range == 0) {
            $this->setRange(25);
        }

        $this->start = ($page - 1) * $this->range;

        return $this;
    }
813225
public function setPage($page) {
    $this->page = intval($page);
    $this->offset = ($page - 1) * $this->pageSize;
  }
1113428
public function withPageAndPerPage($page, $perPage)
    {
        $new = clone $this;
        $new->offset = ($page - 1) * $perPage;
        $new->limit = $perPage;
        $new->paginationType = self::PAGED_PAGINATION;

        return $new;
    }
846463
public function setPage($page = null)
    {
        // The following argument formats are supported:
        //
        // null = set current page
        // '.' = set current page
        // 'page' = sets webroot/page.html
        // './page' = set page relatively to current page
        // '..' = parent page
        // '../page' = page besides our own (foo/bar -> foo/page)
        // 'index' = properly points to the index page defined in APP
        // '/admin/' = will not be converted

        /** @type $this->app App_Web */

        $destination = '';

        if (is_null($page)) {
            $page = '.';
        }

        foreach (explode('/', $page) as $component) {
            if ($component == '') {
                continue;
            }
            if ($component == '.' && $destination == '') {
                if ($this->app->page == 'index') {
                    continue;
                }
                $destination = str_replace('_', '/', $this->app->page);
                continue;
            }

            if ($component == '..') {
                if (!$destination) {
                    $destination = str_replace('_', '/', $this->app->page);
                }
                $tmp = explode('/', $destination);
                array_pop($tmp);
                $destination = implode('/', $tmp);
                continue;
            }

            if ($component == 'index' && $destination == '') {
                $destination = $this->app->index_page;
                continue;
            }

            $destination = $destination ? $destination.'/'.$component : $component;
        }
        if ($destination === '') {
            $destination = @$this->app->index_page;
        }

        $this->page = $destination;

        // check if it's current page
        list($p, $ap) = str_replace('/', '_', array($this->page, $this->app->page));
        $this->_current = ($p == $ap); // page exactly match
        $this->_current_sub = ($p == substr($ap, 0, strlen($p)) && isset($ap[strlen($p)]) && $ap[strlen($p)] == '_'); // first part of page match followed by separator

        return $this;
    }
271167
public function setPage(Page $page)
    {
        $this->_page = $page;
        $page->setMainSection($this);

        return $this;
    }
948143
protected function setPagerListPage()
    {
        $conditions = $this->query_filter;
        $conditions['count'] = true;

        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->page->getList($conditions)
        );

        return $this->data_limit = $this->setPager($pager);
    }
484192
public function setPage($page) {
        if (!is_numeric($page)) {
            $page = self::DEFAULT_PAGE;
        }

        if (0 == $page) {
            $page = self::DEFAULT_PAGE;
        }

        $this->page = $page;

        return $this;
    }
759740
public static function page( int $page , int $count , int $pagesize = 10) :array
    {

//        if(empty($count)){
//            throw new \Exception('Tools page throw : count must is integer and greater than 0!');
//        }
        if( empty($page) || !is_numeric($page) ){
            $page = 1;
        }

        if( empty($pagesize) || !is_numeric($pagesize)){
            $pagesize = 10;
        }

        $maxpage = ceil($count / $pagesize);//获取最大页数

        $limit = [($page - 1) * $pagesize,$pagesize];

        return [
            'page' => $page,
            'pagesize' => $pagesize,
            'count' => $count,
            'maxpage' => $maxpage,
            'limit' => $limit
        ];
    }
450365
public function setCurrentPage($page)
    {
        if ($page > 0 && $page <= $this->getPageCount()) {
            $this->currentpage = $page;
        } else {
            $this->currentpage = 1;
        }

        // $start = ($this->currentpage - 1) * $this->pagesize;
        // $this->setPageRows($start, $this->pagesize);
        //  $this->Reload();
    }
449622
public function get(int $page, int $limit = 10): \Illuminate\Pagination\LengthAwarePaginator
    {
        if (!$this->_columns && !$this->_query) {
            return null;
        }
        $countTotal = $this->_query->count();
        $this->_query->skip(($limit * $page) - $limit);
        $this->_query->limit($limit);
        $data = collect();
        foreach ($this->_query->get() as $key => $instance) {
            if ($instance instanceof \Illuminate\Database\Eloquent\Model) {
                $_listRow = [];
                foreach ($this->_columns->getColumns() as $column) {
                    $_listRow[$column->getKey()] = $column->getValues($instance);
                }
                $buttons = $this->_columns->filterActions($instance);
                if (count($buttons)) {
                    $_listRow = array_merge($_listRow, [Column::ACTION_NAME => implode('', $buttons)]);
                }
                $data->offsetSet($key, $_listRow);
            }
        }
        $this->_data = new \Illuminate\Pagination\LengthAwarePaginator($data, $countTotal, $limit, $page, [
            'path'     => \Illuminate\Pagination\Paginator::resolveCurrentPath(),
            'pageName' => 'page',
        ]);

        return $this->_data;
    }
880021
public function paginate($page, $per_page=10) {
		$this->page = $page = $page ? $page:1;
		$this->per_page = $per_page;
		$this->offset(($page-1)*$per_page);
		$this->limit($per_page);

		return $this;
	}
1287351
public function page($page)
    {
        //set the page
        $this->layout->page = $page;

        //set the layout content and title
        $this->layout->content = view($page);

        return $this->layout;
    }
884846
public function setPage($page)
    {
        $this->offset = (max(1, (int) $page) - 1) * $this->perPage;

        return $this;
    }
1143363
public function setPage(Page $page)
    {
        $this->page = $page;
        $revision = $page->getCurrentRevision();
        if (empty($revision)) {
            $revision = $page->getPublishedRevision();
        }
        $revisionId = null;
        if (!empty($revision)) {
            $revisionId = $revision->getRevisionId();
        }
        $this->setRevisionId($revisionId);
        $this->setTitle($page->getPageTitle());
        $this->setPageId($page->getPageId());
    }