fromholdio / silverstripe-paged
A small SilverStripe module that applies pagination functionalities to a Controller and its datalist/s.
Installs: 1 064
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:silverstripe-vendormodule
pkg:composer/fromholdio/silverstripe-paged
Requires
- silverstripe/cms: ^6.0
This package is auto-updated.
Last update: 2025-10-20 18:23:17 UTC
README
A small SilverStripe module that applies pagination functionalities to a Controller and its datalist/s.
- Extends the core
PaginatedListto also haveAbsoluteNextLinkandAbsolutePrevLink(in addition to regularNextLinkandPrevLink) - Adds
PrevPageNumandNextPageNumtoPaginatedList - Adds (
int)PagedLimitto the extendedPage - Extends the
PageControllerto get aDataList, wrap it in aPaginatedList, applies thePagedLimitand 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.
Requirements
(silverstripe-framework ^4 and ^5 available on branch 1.x)
Installation
composer require fromholdio/silverstripe-paged
Details & Usage
Install, and then apply:
PagedSiteTreeExtensionto yourPageclass (or subclass)PagedControllerExtensionto yourPageControllerclass (or subclass)
On your extended Controller, you must set the following config variable to point the pagination to the source DataList:
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.
To Do
- Better docs