How to custom display numbers in CakePHP Paginator

1k views Asked by At

I'm trying to change the display of links on a search result page.This is how the links display on my page:

1 2 3 4 5 6 7 8 9 10 | Next10
1 is current page.

After clicked on Next10 link, I want it display like this:
11 12 13 14 15 16 17 18 19 20 | Next10

I 've spend hours on it. But I couldn't find the way to make it work. Is there any solution?

I use

'echo $this->Paginator->link('Next10',array('page' => $this->Paginator->params('page') + 11));'

for the view.

1

There are 1 answers

0
Ben Hitchcock On

You're going to have to write your own paginator function to display the numbers. What you're after (and what Cake doesn't support) is a different modulus for pages before and after the displayed page. Cake only supports one modulus argument:

http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#creating-page-number-links