Commit bb831f22 authored by Daniel Siepmann's avatar Daniel Siepmann Committed by Benni Mack
Browse files

[DOCS] Complete new pagination changelog rst

Add missing pagination example to feature rst.
Only paginator is not enough to actually create a new pagination.

Relates: #89603
Releases: master, 10.4
Change-Id: Ie6852b76fb79f131d3b8553640ef29ab60e072de
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69723

Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 7e6a9da5
......@@ -36,6 +36,7 @@ Code-Example for the :php:`ArrayPaginator`:
.. code-block:: php
// use TYPO3\CMS\Core\Pagination\ArrayPaginator;
// use TYPO3\CMS\Core\Pagination\SimplePagination;
$itemsToBePaginated = ['apple', 'banana', 'strawberry', 'raspberry', 'ananas'];
$itemsPerPage = 2;
......@@ -47,4 +48,11 @@ Code-Example for the :php:`ArrayPaginator`:
$paginator->getKeyOfFirstPaginatedItem(); // returns 4
$paginator->getKeyOfLastPaginatedItem(); // returns 4
$pagination = new SimplePagination($paginator);
$pagination->getAllPageNumbers(); // returns [1, 2, 3]
$pagination->getPreviousPageNumber(); // returns 2
$pagination->getNextPageNumber(); // returns null
// …
.. index:: PHP-API, ext:core
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment