Pagination
class Pagination implements PaginationInterface
Pagination class.
Properties
protected int | $items | Number of items. | |
protected int | $itemsPerPage | Number of items per page. | |
protected int | $currentPage | Current page. | |
protected array | $options | Options. | |
protected int | $pages | Number of pages. | |
protected int | $offset | Offset. | |
protected Request | $request | Request instance. | |
protected array | $params | Query parameter cache. | |
protected URLBuilder | $urlBuilder | URL builder instance. | |
protected ViewFactory | $viewFactory | View factory instance. | |
protected array | $pagination | Pagination. |
Methods
Constructor.
Returns the number of items.
Returns the number of items per page.
Returns the current page.
Returns TRUE if we're on a valid page and FALSE if not.
Returns the number pages.
Returns the limit.
Returns the offset.
Builds a url to the desired page.
Returns an array representation of the pagination object.
Returns data which can be serialized by json_encode().
Returns a json representation of the pagination object.
Builds and returns the pagination array.
Renders and returns the pagination partial.
Details
at line 108
__construct(int $items, int $itemsPerPage, int $currentPage, array $options = [])
Constructor.
at line 130
int
items()
Returns the number of items.
at line 138
int
itemsPerPage()
Returns the number of items per page.
at line 146
int
currentPage()
Returns the current page.
at line 154
bool
isValidPage()
Returns TRUE if we're on a valid page and FALSE if not.
at line 162
int
numberOfPages()
Returns the number pages.
at line 170
int
limit()
Returns the limit.
at line 178
int
offset()
Returns the offset.
at line 188
setRequest(Request $request)
Sets the request instance.
at line 198
setURLBuilder(URLBuilder $urlBuilder)
Sets the URL builder instance.
at line 208
setViewFactory(ViewFactory $viewFactory)
Sets the view factory builder instance.
at line 219
protected string
buildPageUrl(int $page)
Builds a url to the desired page.
at line 232
array
toArray()
Returns an array representation of the pagination object.
at line 262
array
jsonSerialize()
Returns data which can be serialized by json_encode().
at line 270
string
toJson(int $options = 0)
Returns a json representation of the pagination object.
at line 280
array
pagination()
Builds and returns the pagination array.
at line 346
string
render(string $view)
Renders and returns the pagination partial.