Collection

Extends Array. An iterator Object designed to work with either an array or paginated data set.

Methods
isFirstPage()

Returns Boolean

True if the current page is the first in the series, else false.

isLastPage()

Returns Boolean

True if the current page is the last in the series, else false.

length()

Returns Number

The number of rows in the current page of data in the collection.

nextPage()

Returns Number | Boolean

Returns the page number of the next page, or false if no next page is available.

nextPageUrl()

Returns Url | Boolean

Returns a Url based on the current pages Url of the next page, or false if no next page is available.

page()

Returns Number

The current page. Pages for collections a one indexed (i.e. start from 1).

perPage()

Returns Number | Boolean

Returns the number of rows per page if the collection is paginated or false if not paginated.

previousPage()

Returns Number | Boolean

Returns the page number of the previous page, or false if no previous page is available.

previousPageUrl()

Returns Url | Boolean

Returns a Url based on the current pages Url of the previous page, or false if no previous page is available.

total()

Returns Number

The total number of rows across all pages of data in the collection.

totalPages()

Returns Number

The total number of pages in the collection.