A small SilverStripe module that applies pagination functionalities to a Controller and its datalist/s.
A small SilverStripe module that applies pagination functionalities to a
Controller and its datalist/s.
PaginatedListto also have
AbsolutePrevLink(in addition to regular
PagedLimitto the extended
PageControllerto get a
DataList, wrap it in a
PaginatedList, applies the
PagedLimitand returns it
Note that you do not need to extend a
Page, you can simply add the extension to a
Controller that is already returning a
DataList and the extension will provide the pagination capability.
This module is really just a timesaver for otherwise repetitive and often used functionality.
composer require fromholdio/silverstripe-paged
Install, and then apply:
Pageclass (or subclass)
PageControllerclass (or subclass)
On your extended
Controller, you must set the following config variable to point the pagination to the source
MyNamespace\MyControllerClass: paged_source_method: 'getMyFullDataList'
If you do not have a page associated to the controller, you can define a per-page-limit on the controller too:
MyNamespace\MyControllerClass: paged_limit: 12
Review the source, you'll find some hooks in there to update the paginated list and or limit from your base/extended classes, too.
More thorough docs to come. In the meantime please submit questions as issues.
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem