TYPO3 Logo
TYPO3 Explained
Release: 10.4

Loading data.

  • Quick Links
    • Configuration Overview
    • Database (doctrine-dbal)
    • Dependency Injection
    • Digital Assets Management
    • Fluid
    • Internationalization and Localization
    • Mail API
    • Request Handling (Middlewares)
    • Routing - "Speaking URLs"
    • Security Guidelines
    • Site Handling
  • Introduction
  • Extension Development
    • Introduction
    • Extension Management
    • System and Local Extensions
    • Files and Locations
    • composer.json
    • Declaration File (ext_emconf.php)
    • Configuration Files (ext_tables.php & ext_localconf.php)
    • Naming Conventions
    • Extension Configuration (ext_conf_template.txt)
    • Extending the TCA Array
      • Storing the Changes
      • Customization Examples
      • Verifying the TCA
    • Choosing an extension key
    • Creating a new Extension
    • Creating a new Distribution
    • Adding Documentation
    • Publish Your Extension
    • Other resources

TYPO3 A-Z

  • AJAX
    • Client-Side Programming
    • Backend
  • Assets (CSS, JavaScript, Media)
  • Authentication
  • Autoloading
  • Backend Access Control (Users & Roles)
    • Users and Groups
    • Password Reset Functionality
    • Roles
    • Access Control Options
    • Other Options
    • More About File Mounts
    • Backend Users Module
  • Backend Modules
    • Backend Interface
    • The Backend Template View
    • Backend Module API
  • Backend Routing
  • Backend User Object
  • Bootstrapping
  • Broadcast Channels
  • Caching
    • Quick Start for Integrators
    • Configuration
    • Caching Framework Architecture
    • Cache Frontends
    • Cache backends
    • Developer Information
  • Coding Guidelines
    • Introduction
    • PHP Coding Guidelines
      • PHP File Formatting
        • General Requirements for PHP Files
        • File Structure
        • PHP Syntax Formatting
        • Using phpDoc
      • PHP Architecture
        • Modeling Cross Cutting Concerns
          • Static Methods, static Classes, Utility Classes
          • Traits
          • Services
        • Working With Exceptions
        • General Links
      • Coding: Best practices
        • Accessing the Database
        • Singletons
        • Static Methods
        • Localization
        • Unit Tests
        • Handling Deprecation
        • Namespaces and Class Names of User Files
        • Hook Naming
    • JavaScript Coding Guidelines
    • TypeScript Coding Guidelines
    • TypoScript Coding Guidelines
    • TSconfig Coding Guidelines
    • Xliff Coding Guidelines
    • Yaml Coding Guidelines
    • reStructuredText (reST)
  • Configuration
    • Configuration overview
    • Glossary
    • Feature Toggles
    • $GLOBALS
    • $GLOBALS[‘TYPO3_CONF_VARS’]
    • Global Meta Information about TYPO3
    • TSconfig
    • TypoScript Syntax
      • What Is TypoScript?
      • Syntax
        • Introduction
        • Contexts
        • TypoScript syntax
        • Conditions
        • Includes
      • Sorting out Details
        • Parsing, Storing and Executing TypoScript
        • Myths, FAQ and Acknowledgements
      • The TypoScript Parser API
        • Introduction
        • Parsing Custom TypoScript
        • Implementing Custom Conditions
    • User Settings Configuration
      • [‘columns’] Section
      • [‘showitem’] Section
      • Extending the User Settings
      • View the Configuration
    • YAML API
    • YAML syntax
  • Constants
  • Content Elements & Plugins
    • Introduction
    • Create Custom Content Elements
    • Create Plugins
    • Configure Custom Backend Preview for Content Element
    • Add Elements to the Content Element Wizard
    • Flexforms
    • T3DataStructure
      • Elements
      • Sheet References
      • Parsing a Data Structure
    • Backend Layout
    • Best practices
  • Context API and Aspects
  • Context Sensitive Help (CSH)
    • The $TCA_DESCR Array
    • The Language Files for CSH
    • Implementing CSH
  • Crop Variants for Images
    • General Configuration
    • Crop variants configuration per content element
  • Custom File Processors
  • Database (doctrine-dbal)
    • Introduction
    • Configuration
    • Database Structure
    • Upgrade Table and Field Definitions
    • Basic CRUD
    • Class Overview
    • ConnectionPool
    • QueryBuilder
    • Connection
    • ExpressionBuilder
    • RestrictionBuilder
    • Statement
    • QueryHelper
    • Migrating from TYPO3_DB
    • Various Tips and Tricks
  • Debugging
  • Dependency Injection
  • Deprecation
  • Digital Assets Management (FAL)
    • Introduction
    • Basic Concepts
    • Architecture
      • Overview
      • Folders
      • Database Structure
      • Components
      • PSR-14 Events
    • Administration
      • Permissions
      • File Storages
      • Maintenance
    • Using FAL
      • Using FAL in the Frontend
      • TCA Definition
      • The ResourceFactory Class
      • Working With Files, Folders and File References
      • Working With Collections
      • Searching for Files
  • Directory Structure
  • Enumerations & BitSets
    • How To Use Enumerations
    • How To Use BitSets
  • Environment
  • Error and Exception Handling
    • Configuration
    • Error Handler
    • Production Exception Handler
    • Debug Exception Handler
    • Examples
    • How to extend the error and exception handling
  • Events, Signals and Hooks
    • Extending the TYPO3 Core
    • EventDispatcher (PSR-14 Events)
    • List of Core PSR-14 Events
      • AfterFormEnginePageInitializedEvent
      • AfterHistoryRollbackFinishedEvent
      • AfterPageColumnsSelectedForLocalizationEvent
      • BeforeFormEnginePageInitializedEvent
      • BeforeHistoryRollbackStartEvent
      • ModifyPageLayoutOnLoginProviderSelectionEvent
      • SwitchUserEvent
      • SystemInformationToolbarCollectorEvent
      • AfterTcaCompilationEvent
      • ModifyLoadedPageTsConfigEvent
      • AlterTableDefinitionStatementsEvent
      • AppendLinkHandlerElementsEvent
      • IsTableExcludedFromReferenceIndexEvent
      • BrokenLinkAnalysisEvent
      • AfterMailerInitializationEvent
      • AfterPackageActivationEvent
      • AfterPackageDeactivationEvent
      • BeforePackageActivationEvent
      • PackagesMayHaveChangedEvent
      • BeforeJavaScriptsRenderingEvent
      • BeforeStylesheetsRenderingEvent
      • AfterFileAddedEvent
      • AfterFileAddedToIndexEvent
      • AfterFileContentsSetEvent
      • AfterFileCopiedEvent
      • AfterFileCreatedEvent
      • AfterFileDeletedEvent
      • AfterFileMarkedAsMissingEvent
      • AfterFileMetaDataCreatedEvent
      • AfterFileMetaDataDeletedEvent
      • AfterFileMovedEvent
      • AfterFileProcessingEvent
      • AfterFileRemovedFromIndexEvent
      • AfterFileRenamedEvent
      • AfterFileReplacedEvent
      • AfterFileUpdatedInIndexEvent
      • AfterFolderAddedEvent
      • AfterFolderCopiedEvent
      • AfterFolderDeletedEvent
      • AfterFolderMovedEvent
      • AfterFolderRenamedEvent
      • AfterResourceStorageInitializationEvent
      • BeforeFileAddedEvent
      • BeforeFileContentsSetEvent
      • BeforeFileCopiedEvent
      • BeforeFileCreatedEvent
      • BeforeFileDeletedEvent
      • BeforeFileMovedEvent
      • BeforeFileProcessingEvent
      • BeforeFileRenamedEvent
      • BeforeFileReplacedEvent
      • BeforeFolderAddedEvent
      • BeforeFolderCopiedEvent
      • BeforeFolderDeletedEvent
      • BeforeFolderMovedEvent
      • BeforeFolderRenamedEvent
      • BeforeResourceStorageInitializationEvent
      • EnrichFileMetaDataEvent
      • GeneratePublicUrlForResourceEvent
      • ModifyIconForResourcePropertiesEvent
      • SanitizeFileNameEvent
      • ModifyTreeDataEvent
      • AfterRequestDispatchedEvent
      • BeforeActionCallEvent
      • AfterObjectThawedEvent
      • EntityAddedToPersistenceEvent
      • EntityPersistedEvent
      • EntityRemovedFromPersistenceEvent
      • EntityUpdatedInPersistenceEvent
      • ModifyQueryBeforeFetchingObjectDataEvent
      • ModifyResultAfterFetchingObjectDataEvent
      • AfterExtensionDatabaseContentHasBeenImportedEvent
      • AfterExtensionFilesHaveBeenImportedEvent
      • AfterExtensionStaticDatabaseContentHasBeenImportedEvent
      • AvailableActionsForExtensionEvent
      • ModifyHrefLangTagsEvent
      • LoginConfirmedEvent
      • ModifyLoginFormViewEvent
      • SendRecoveryEmailEvent
      • BeforeImportEvent
      • ModifyLanguagePackRemoteBaseUrlEvent
      • BeforeRecordIsAnalyzedEvent
      • ModifyUrlForCanonicalTagEvent
      • AddJavaScriptModulesEvent
      • AfterCompiledCacheableDataForWorkspaceEvent
      • AfterDataGeneratedForWorkspaceEvent
      • GetVersionedDataEvent
      • SortVersionedDataEvent
    • Signals and Slots (deprecated)
    • Hooks
    • JavaScript Event API
      • Regular Event
      • Debounce Event
      • Throttle Event
      • RequestAnimationFrame Event
  • Extension Scanner
  • Flash Messages
  • Fluid
    • Introduction to Fluid
  • FormEngine
    • Introduction
    • Main Rendering Workflow
    • Data Compiling
    • Rendering
  • Form Protection Tool
  • HTTP Request Library / Guzzle / PSR-7
  • Icon API
  • Internationalization and Localization
    • Introduction
    • Supported languages
    • Managing Translations
    • Translation Servers
      • Localization with Crowdin
        • Extension Integration
        • Online Translation with Crowdin
        • Workflow
        • Frequently Asked Questions (FAQ)
      • Localization with Pootle
      • Custom Translation Servers
    • XLIFF Format
    • Working with XLIFF files
  • JavaScript in TYPO3 Backend
    • RequireJS in the TYPO3 Backend
      • Use RequireJS in Your Own Extension
      • Dependency Handling
      • Loading Your Own or Other RequireJS Modules
      • Shim Library to Use it as Own RequireJS Modules
    • Various JavaScript Modules
      • Modals
      • Multi-Step Wizard
      • DocumentService (jQuery.ready substitute)
    • Event Api
    • Navigation via JavaScript
    • JavaScript Form Helpers
  • Linkbrowser
    • LinkBrowser API
    • LinkHandler Api
  • Locking API
  • Logging Framework
    • Quickstart
    • Logger
    • Configuration of the Logging System
    • The LogRecord Model
    • Log Writers
    • Log Processors
  • Mail API
  • Namespaces
  • Page Types
  • Pagination
  • Password Hashing
  • Request Handling (Middlewares)
    • TYPO3 Request Object
  • Rich Text Editors (RTE)
    • CKEditor Rich Text Editor
    • Rich Text Editors in the TYPO3 Backend
      • Introduction
      • Plugging a RTE
    • RTE Transformations
      • Introduction
      • Transformation Overview
      • Custom Transformations API
    • Historical Perspective on RTE Transformations
      • Properties and Transformations
      • RTE Transformations in Content Elements
  • Routing - “Speaking URLs” in TYPO3
    • Introduction to Routing
    • Page based Routing
    • Advanced Routing Configuration (for Extensions)
    • Extending Routing
    • Collection of various routing examples
  • Security Guidelines
    • Introduction
    • The TYPO3 Security Team
    • General Information
    • Types of Security Threats
    • General Guidelines
    • Guidelines for System Administrators
    • Guidelines for TYPO3 Integrators
    • Guidelines for Editors
    • Backup Strategy
    • Detect, Analyze and Repair a Hacked Site
  • SEO
    • MetaTag API
    • PageTitle API
    • XML Sitemap
  • Services
    • Introduction
    • Using Services
      • Service Precedence
      • Simple Use
      • Use With Subtypes
      • Calling a Chain of Services
    • Configuration
      • Registration Changes
      • Service Configuration
      • Service Type Configuration
    • Developer’s Guide
      • Introducing a New Service Type
      • Implementing a Service
      • Service API
      • Service-related API
  • Session Storage Framework
  • Site Handling
    • Basics
    • Creating a new Site
    • Base Variants
    • Adding Languages
    • Error Handling
    • Writing a Custom Page Error Handler
    • Static Routes
    • Using Environment Variables in Site Configuration
    • Using Site Configuration in TypoScript
    • Using Site Config in Conditions
    • Site Settings
    • CLI Tools for Site Handling
    • PHP API: Accessing Site Configuration
    • Extending Site Configuration
  • Soft References
  • Symfony Console Commands (cli)
  • Symfony Expression Language
  • System Categories
  • System Collections
  • System Log
  • System Registry
  • TCE (TYPO3 Core Engine) & DataHandler
    • Introduction
    • Database: DataHandler Basics (Formerly Known as TCEmain)
    • Using DataHandler in Scripts
    • The “/record/commit” Route
    • File Functions Basics
    • The “tce_file.php” API
  • Testing
    • History
    • Core testing
    • Extension testing
    • Project testing
    • Writing unit tests
    • Writing functional tests
    • Writing acceptance tests
    • FAQ
  • Upgrade Wizards
    • The Concept of Upgrade Wizards
    • Creating upgrade wizards
    • class.ext_update.php
  • Versioning and Workspaces
  • XCLASSes (Extending Classes)
  • Index
  • Sitemap
  • About This Manual
  • Link Targets

PAGE CONTENTS

  • Pagination
  1. Start
  2. Pagination
How to edit Edit on GitHub View source

Pagination¶

Note

Pagination via Fluid widgets will be removed in TYPO3v11, see Breaking: #92529 - All Fluid widget functionality removed. Use the API documented here to implement your own pagination.

The TYPO3 core provides an interface to implement the native pagination of lists like arrays or query results of Extbase.

The foundation of that new interface \TYPO3\CMS\Core\Pagination\PaginatorInterface is that it’s type agnostic. It means, that it doesn’t define the type of paginatable objects. It’s up to the concrete implementations to enable pagination for specific types. The interface only forces you to reduce the incoming list of items to an iterable sub set of items.

Along with that interface, an abstract paginator class \TYPO3\CMS\Core\Pagination\AbstractPaginator is available that implements the base pagination logic for any kind of Countable set of items while it leaves the processing of items to the concrete paginator class.

Two concrete paginators are available. One for array and one for \TYPO3\CMS\Extbase\Persistence\QueryResultInterface objects.

Code-Example for the ArrayPaginator:

// use TYPO3\CMS\Core\Pagination\ArrayPaginator;

$itemsToBePaginated = ['apple', 'banana', 'strawberry', 'raspberry', 'pineapple'];
$itemsPerPage = 2;
$currentPageNumber = 3;

$paginator = new ArrayPaginator($itemsToBePaginated, $currentPageNumber, $itemsPerPage);
$paginator->getNumberOfPages(); // returns 3
$paginator->getCurrentPageNumber(); // returns 3, basically just returns the input value
$paginator->getKeyOfFirstPaginatedItem(); // returns 5
$paginator->getKeyOfLastPaginatedItem(); // returns 5
  • Previous
  • Next
  • Contact
  • Issues
  • Repository

Last updated: Mar 23, 2021 15:04

Last rendered: Apr 15, 2021 13:33

TYPO3 Theme 4.5.2

© Copyright since 2000 by the TYPO3 Documentation Team
  • Legal Notice
  • Privacy Policy