public function paginate($page = 1, $perPage = 15)
    {
        $cacheKey = "$page|$perPage";

        if (isset($this->_paginationCache[$cacheKey])) {
            return $this->_paginationCache[$cacheKey];
        }

        $this->parseInputOnce();

        $this->_paginationCache[$cacheKey] = $this->createPaginator(
            $this->filters,
            $this->sorting(),
            $this->queryKeys(),
            $page,
            $perPage
        );

        return $this->_paginationCache[$cacheKey];

    }
public function paginate($page = 1, $perPage = 15)
    {
        $cacheKey = "$page|$perPage";

        if (isset($this->_paginationCache[$cacheKey])) {
            return $this->_paginationCache[$cacheKey];
        }

        $this->parseInputOnce();

        $this->_paginationCache[$cacheKey] = $this->createPaginator(
            $this->filters,
            $this->sorting(),
            $this->queryKeys(),
            $page,
            $perPage
        );

        return $this->_paginationCache[$cacheKey];

    }
public function paginate ( $ page = 1 , $ perPage = 15 ) { $ cacheKey = "$page|$perPage" ; if ( isset ( $ this -> _paginationCache [ $ cacheKey ] ) ) { return $ this -> _paginationCache [ $ cacheKey ] ; } $ this -> parseInputOnce ( ) ; $ this -> _paginationCache [ $ cacheKey ] = $ this -> createPaginator ( $ this -> filters , $ this -> sorting ( ) , $ this -> queryKeys ( ) , $ page , $ perPage ) ; return $ this -> _paginationCache [ $ cacheKey ] ; }
Paginate the result. Return whatever paginator you use.
The paginator should be \Traversable.

@param int $page (optional)
@param int $perPage (optional)

@return \Traversable|array A paginator instance or just an array
Paginate the result . Return whatever paginator you use . The paginator should be \ Traversable .