# Multiple paginations in one controller

**URL:** <https://discourse.cakephp.org/t/multiple-paginations-in-one-controller/1953>\
**Category:** Need Help\
**Created:** [January 30, 2017, 11:29am UTC](https://discourse.cakephp.org/t/multiple-paginations-in-one-controller/1953 "2017-01-30T11:29:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepak](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/deepak/32/906_2.png) [@Deepak](https://discourse.cakephp.org/u/Deepak)\
**Post date:** [January 30, 2017, 11:29am UTC](https://discourse.cakephp.org/t/multiple-paginations-in-one-controller/1953/1 "2017-01-30T11:29:37Z")

</div>

I have one models. I want to paginate them in one view. The problem is that when I go to the next page of one model, for example Post, the other model (Comment), also goes to the next page.

I want to multiple pagination in one view in tab content .  
i want to filter data like :

**1. All member list.**  
**2.Male member List**  
**3. Female member list**

I want fetch data from Users model in users controller and show in view in tabbing form like Allmember,Malemember ,femalemember

---

<div class="post-metadata">

**Author:** ![lorenzo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/lorenzo/32/25_2.png) [@lorenzo](https://discourse.cakephp.org/u/lorenzo)\
**Post date:** [February 3, 2017, 2:32pm UTC](https://discourse.cakephp.org/t/multiple-paginations-in-one-controller/1953/2 "2017-02-03T14:32:54Z")

</div>

Have you tried loading each of the lists using ajax? That is usually the most straight forward way of paginating multiple lists in the same page.

---

<div class="post-metadata">

**Author:** ![anhtu032](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@anhtu032](https://discourse.cakephp.org/u/anhtu032)\
**Post date:** [March 27, 2017, 7:27am UTC](https://discourse.cakephp.org/t/multiple-paginations-in-one-controller/1953/3 "2017-03-27T07:27:08Z")

</div>

> [@Deepak](#):
>
> I have one models. I want to paginate them in one view. The problem is that when I go to the next page of one model, for example Post, the other model (Comment), also goes to the next page.
> 
> I want to multiple pagination in one view in tab content .  
> i want to filter data like :
> 
> 1. All member list.  
> 2.Male member List
> 2. Female member list
> 
> I want fetch data from Users model in users controller and show in view in tabbing form like Allmember,Malemember ,femalemember

Hi,  
add "[‘scope’ =\> ‘categories’]  
In Controller:  
…  
$this-\>pagination(…,[‘scope’ =\> ‘your model’]);  
…  
In View:

\<?= $this-\>Paginator-\>prev('\< ' . \_\_('previous'),['model'=\>'your model']) ?\> \<?= $this-\>Paginator-\>numbers(['model'=\>'your model']) ?\> \<?= $this-\>Paginator-\>next(\_\_('next') . ' \>',['model'=\>'your model']) ?\>

similar for counter,first and last.
