# Paginator numbers helper (4x)

**URL:** <https://discourse.cakephp.org/t/paginator-numbers-helper-4x/11593>\
**Category:** Need Help\
**Tags:** help\
**Created:** [October 24, 2023, 7:16am UTC](https://discourse.cakephp.org/t/paginator-numbers-helper-4x/11593 "2023-10-24T07:16:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yogeshsaroya](https://avatars.discourse-cdn.com/v4/letter/y/f05b48/32.png) [@yogeshsaroya](https://discourse.cakephp.org/u/yogeshsaroya)\
**Post date:** [October 24, 2023, 7:16am UTC](https://discourse.cakephp.org/t/paginator-numbers-helper-4x/11593/1 "2023-10-24T07:16:59Z")

</div>

I am using this code for pagination links

```auto
<nav class="nav_pag">
    <ul class=" pagination justify-content-center">
        <li class="page-item">
            <?php
            echo $this->Paginator->first(__('First', true), array('tag' => 'li', 'escape' => false), array('type' => "button", 'class' => "page-link"));
            echo $this->Paginator->prev('&laquo;', array('tag' => 'li', 'escape' => false), '<a href="#">&laquo;</a>', array('class' => 'prev disabled', 'tag' => 'li', 'escape' => false));
            echo $this->Paginator->numbers(['first' => 1, 'last' => 1],[['separator' => '', 'tag' => 'li', 'currentLink' => true, 'currentClass' => 'active', 'currentTag' => 'a']]);
            echo $this->Paginator->next('&raquo;', array('tag' => 'li', 'escape' => false), '<a href="#">&raquo;</a>', array('class' => 'prev disabled', 'tag' => 'li', 'escape' => false));
            echo $this->Paginator->last(__('Last', true), array('tag' => 'li', 'escape' => false), array('type' => "button", 'class' => "page-link"));
            ?>
    </ul>
</nav>

```

at mobile for $this-\>Paginator-\>numbers i just want to show 2 or max 5 pages link but its showing max 10. How to fix it?

$this-\>Paginator-\>numbers([‘first’ =\> 1, ‘last’ =\> 1]) is not working.

Thanks

---

<div class="post-metadata">

**Author:** ![Rest](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rest](https://discourse.cakephp.org/u/Rest)\
**Post date:** [October 24, 2023, 7:46am UTC](https://discourse.cakephp.org/t/paginator-numbers-helper-4x/11593/2 "2023-10-24T07:46:00Z")

</div>

Good day. Maybe you should try setting a limit ?

Here’s my code in my Controller in the index  
$data = $this-\>paginate($this-\>Data,[‘limit’=\> ‘10’]);

It now shows me more pages depending on the contents i have within the pages i have.

i hope it helps
