Download the PHP package fromholdio/silverstripe-paged without Composer
On this page you can find all versions of the php package fromholdio/silverstripe-paged. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fromholdio/silverstripe-paged
More information about fromholdio/silverstripe-paged
Files in fromholdio/silverstripe-paged
Package silverstripe-paged
Short Description A small SilverStripe module that applies pagination functionalities to a Controller and its datalist/s.
License BSD-3-Clause
Homepage https://github.com/fromholdio/silverstripe-paged
Informations about the package silverstripe-paged
silverstripe-paged
A small SilverStripe module that applies pagination functionalities to a Controller
and its datalist/s.
- Extends the core
PaginatedList
to also haveAbsoluteNextLink
andAbsolutePrevLink
(in addition to regularNextLink
andPrevLink
) - Adds (
int
)PagedLimit
to the extendedPage
- Extends the
PageController
to get aDataList
, wrap it in aPaginatedList
, applies thePagedLimit
and 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
Installation
composer require fromholdio/silverstripe-paged
Details & Usage
Install, and then apply:
PagedSiteTreeExtension
to yourPage
class (or subclass)PagedControllerExtension
to yourPageController
class (or subclass)
On your extended Controller
, you must set the following config variable to point the pagination to the source DataList
:
If you do not have a page associated to the controller, you can define a per-page-limit on the controller too:
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