0

How to set url parameters into paginator numbers?

My url is company/overview/3?page=1&sort=Tenancies.stage&direction=asc

In default only the first paginator number has the parameter. How can I apply the parameters to number 2, 3, 4... ?

Here is my view:

    <div class="row paginator">
        <div class="col-lg-12">
            <div class="pull-left"><?= $this->Paginator->counter() ?></div>
            <ul class="pagination pull-right">
                <?= $this->Paginator->prev('< ' . __('previous')) ?>
                <?= $this->Paginator->numbers() ?>
                <?= $this->Paginator->next(__('next') . ' >') ?>
            </ul>
        </div>
    </div>
Fury
  • 4,643
  • 5
  • 50
  • 80

1 Answers1

1

Simply just add this line

<?php $this->Paginator->options(['url' => $this->request->query]) ?>

For example:

<div class="row paginator">
        <div class="col-lg-12">
            <div class="pull-left"><?= $this->Paginator->counter() ?></div>
            <ul class="pagination pull-right">
                <?php $this->Paginator->options(['url' => $this->request->query]) ?>
                <?= $this->Paginator->prev('< ' . __('previous')) ?>
                <?= $this->Paginator->numbers() ?>
                <?= $this->Paginator->next(__('next') . ' >') ?>
            </ul>
        </div>
    </div>
Fury
  • 4,643
  • 5
  • 50
  • 80