-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them
Description
PHP Version
8.0
CodeIgniter4 Version
4.1.2
CodeIgniter4 Installation Method
Composer (as dependency to an existing project)
Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Database
MariaDB 10.6.5
What happened?
Can't use multiple pagers on the same view. I followed docs from here.
Steps to Reproduce
Here is my simplified Controller function:
public function view(int $clientId)
{
$contacts = $this->getContactProvider();
$orders = $this->getOrderProvider();
return view($this->viewPrefix . 'view', [
'title' => lang('Client.client'),
'contacts' => $contacts->whereClient($clientId)->paginate(preference('Pager.perPage'), 'contacts'),
'orders' => $orders->whereClient($clientId)->paginate(preference('Pager.perPage'), 'orders'),
'pager' => $contacts->whereClient($clientId)->pager,
]);
}Expected Output
Get two groups in Pager instance and show pagers in view with
<?= $pager->simpleLinks('contacts') ?>
<?= $pager->links('orders') ?>Anything else?
Within view I can show two paginations, but can access only that one where I'm calling pager method.

But when I manually specify page_contacts like:
?page_contacts=2&page_orders=1
It will show previous page in pagination
I'm expecting both paginations the same, because there is two pages for both of results.
Metadata
Metadata
Assignees
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them

