Well it depends on how you setup your paginationControl partial or viewpage script.
The paginationControl parameters:
PaginationControl::__invoke(Paginator $myPaginator, $scrollingStyle, $partial, $params);
So within your partial or viewpage script for the pagination you are able to access all the stuff you passed to the $params
parameter, like you would with your parameters you pass from your controller to your view pages or the partial viewhelper.
You could pass a parameter to the partial like the route to use and its route and query parameters.
$this->paginationControl(
$posts,
'sliding',
'application/partial/pagination',
[
'route' => 'home',
'routeParams' => ['lang' => 'it'],
'queryParams' => []
]
);
So now within your pagination partial you could use the route, routeParams and queryParams - Template used - Item pagination.
<?php
if (!isset($queryParams)) {
$queryParams = [];
}
if (!isset($routeParams)) {
$routeParams = [];
}
?>
<?php if ($this->pageCount): ?>
<div class="paginationControl">
<?= $this->firstItemNumber; ?> - <?= $this->lastItemNumber; ?>
<?= $this->translate('of'); ?> <?= $this->totalItemCount; ?>
<!-- First page link -->
<?php if (isset($this->previous)): ?>
<a href="<?= $this->url(
$this->route,
$routeParams,
ArrayUtils::merge($queryParams, ['query' => ['page' => $this->first]])
); ?>">
<?= $this->translate('First'); ?>
</a> |
<?php else: ?>
<span class="disabled"><?= $this->translate('First') ?></span> |
<?php endif; ?>
<!-- Previous page link -->
<?php if (isset($this->previous)): ?>
<a href="<?= $this->url(
$this->route,
$queryParams,
ArrayUtils::merge($queryParams, ['query' => ['page' => $this->previous]])
); ?>">
< <?= $this->translate('Previous') ?>
</a> |
<?php else: ?>
<span class="disabled">< <?= $this->translate('Previous') ?></span> |
<?php endif; ?>
<!-- Next page link -->
<?php if (isset($this->next)): ?>
<a href="<?= $this->url(
$this->route,
$routeParams,
ArrayUtils::merge($queryParams, ['query' => ['page' => $this->next]])
); ?>">
<?= $this->translate('Next') ?> >
</a> |
<?php else: ?>
<span class="disabled"><?= $this->translate('Next') ?> ></span> |
<?php endif; ?>
<!-- Last page link -->
<?php if (isset($this->next)): ?>
<a href="<?= $this->url(
$this->route,
$routeParams,
ArrayUtils::merge($queryParams, ['query' => ['page' => $this->last]])
); ?>">
<?= $this->translate('Last') ?>
</a>
<?php else: ?>
<span class="disabled"><?= $this->translate('Last') ?></span>
<?php endif; ?>