Number of items on each page. If it is less than 1, it means the page size is infinite, and thus a single page contains all items.
The default page size. This property will be returned by [[pageSize]] when page size cannot be determined by pageSizeParam from params.
Whether to always have the page parameter in the URL created by createUrl. If false and [[page]] is 0, the page parameter will not be put in the URL.
A Promise which resolves when this Component has been successfully initialized.
Name of the parameter storing the current page index.
The page size limits. The first array element stands for the minimal page size, and the second the maximal page size. If this is false, it means [[pageSize]] should always return the value of defaultPageSize.
Name of the parameter storing the page size.
Parameters (name => value) that should be used to obtain the current page number and to create new pagination URLs. If not set, all parameters from request will be used instead.
The object element indexed by pageParam is considered to be the current page number (defaults to 0); while the element indexed by pageSizeParam is treated as the page size (defaults to defaultPageSize).
Total number of items.
Whether to check if [[page]] is within valid range. When this property is true, the value of [[page]] will always be between 0 and ([[pageCount]]-1). Because [[pageCount]] relies on the correct value of totalCount which may not be available in some cases (e.g. MongoDB), you may want to set this property to be false to disable the page number validation. By doing so, [[page]] will return the value indexed by pageParam in params.
Creates the URL suitable for pagination with the specified page number. This method is mainly called by pagers when creating URLs used to perform pagination.
the zero-based page number that the URL should point to.
the number of items on each page. If not set, the value of [[pageSize]] will be used.
whether to create an absolute URL. Defaults to false
.
the created URL
the limit of the data. This may be used to set the LIMIT value for a SQL statement for fetching the current page of data. Note that if the page size is infinite, a value -1 will be returned.
Returns a whole set of links for navigating to the first, last, next and previous pages.
whether the generated URLs should be absolute.
the links for navigational purpose. The array keys specify the purpose of the links (e.g. [[LINK_FIRST]]), and the array values are the corresponding URLs.
the offset of the data. This may be used to set the OFFSET value for a SQL statement for fetching the current page of data.
Returns the zero-based current page number.
whether to recalculate the current page based on the page size and item count.
the zero-based current page number.
number of pages
Returns the number of items per page. By default, this method will try to determine the page size by pageSizeParam in params. If the page size cannot be determined this way, defaultPageSize will be returned.
the number of items per page. If it is less than 1, it means the page size is infinite, and thus a single page contains all items.
Returns the value of the specified query parameter. This method returns the named parameter value from params. Null is returned if the value does not exist.
the parameter name
the value to be returned when the specified parameter does not exist in params.
the parameter value
Initializes the object. This method is invoked at the end of the constructor after the object is initialized with the given configuration.
Sets the current page number.
the zero-based index of the current page.
whether to validate the page number. Note that in order to validate the page number, both validatePage and this parameter must be true.
the number of items per page.
whether to validate page size.
Generated using TypeDoc
Pagination represents information relevant to pagination of data items.
When data needs to be rendered in multiple pages, Pagination can be used to represent information such as total item count, [[pageSize|page size]], [[page|current page]], etc. These information can be passed to pagers to render pagination buttons or links.
The following example shows how to create a pagination object and feed it to a pager.
Controller action:
View:
For more details and usage information on Pagination, see the pagination section in this guide.
int limit The limit of the data. This may be used to set the LIMIT value for a SQL statement for fetching the current page of data. Note that if the page size is infinite, a value -1 will be returned. This property is read-only.
array links The links for navigational purpose. The array keys specify the purpose of the links (e.g. [[LINK_FIRST]]), and the array values are the corresponding URLs. This property is read-only.
int offset The offset of the data. This may be used to set the OFFSET value for a SQL statement for fetching the current page of data. This property is read-only.
int $page The zero-based current page number.
int pageCount Number of pages. This property is read-only.
int pageSize The number of items per page. If it is less than 1, it means the page size is infinite, and thus a single page contains all items.
Mahesh S Warrier https://github.com/codespede