Oihana PHP

PaginationTrait

Trait providing helpers to manage the application/api pagination settings.

This trait allows controllers to access the Slim App instance, retrieve the application's pagination definition.

Tags
author

Marc Alcaraz (ekameleon)

since
1.0.0

Table of Contents

Properties

$pagination  : Pagination|null
The pagination definition.

Methods

initializePagination()  : static
Initializes the `pagination` property.

Properties

$pagination

The pagination definition.

public Pagination|null $pagination = null

Methods

initializePagination()

Initializes the `pagination` property.

public initializePagination([array<string|int, mixed> $init = [] ][, ContainerInterface|null $container = null ]) : static

This method retrieves the default pagination settings for the application, either from the provided initialization array or from the dependency injection container.

Parameters
$init : array<string|int, mixed> = []

Optional initialization array (e.g., ['pagination' => Pagination instance]).

$container : ContainerInterface|null = null

Optional DI container used to retrieve the default pagination definition.

Tags
throws
ContainerExceptionInterface

If the container encounters an error while retrieving an entry.

NotFoundExceptionInterface

If no entry was found in the container for the given identifier.

ReflectionException

If a class or method cannot be reflected.

Return values
static

Returns the current instance for method chaining.

On this page

Search results