1

right now it shows: prev 1 2 3 4 5 6 7 8 9 next

I need to show all the pages (ie) prev 1 2 3 4 5 6 7 8 9 10 11 12 13 ..and so on

here is the code

<?php echo $paginator->prev('Previous'); ?><big>&nbsp;&nbsp;&nbsp;</b>|<b>&nbsp;&nbsp;
<?php echo $paginator->numbers(array('separator'=>'&nbsp;&nbsp;&nbsp;</b>|<b>&nbsp;&nbsp;&nbsp;')); ?>&nbsp;&nbsp;&nbsp;</b>|<b>&nbsp;&nbsp;</big>
<?php echo $paginator->next('Next'); ?>
Polynomial
  • 27,674
  • 12
  • 80
  • 107
  • possible duplicate of [pagination - 10 pages per page](http://stackoverflow.com/questions/3036909/pagination-10-pages-per-page) – Polynomial Nov 27 '11 at 23:51
  • I wouldn't consider this a duplicate, as this is specifically about (and solved by) the CakePHP PaginatorHelper. Hand-coded pagination links wouldn't be a good solution to this question. – brism Nov 28 '11 at 18:42

1 Answers1

4

According to the CakePHP documentation for the numbers method of the PaginatorHelper you can tell it how many items to display on either side of the current item by specifying the modulus option.

Change your second line to this:

<?php echo $paginator->numbers(array('modulus'=>PHP_INT_MAX,'separator'=>'&nbsp;&nbsp;&nbsp;</b>|<b>&nbsp;&nbsp;&nbsp;')); ?>&nbsp;&nbsp;&nbsp;</b>|<b>&nbsp;&nbsp;</big>
Trott
  • 66,479
  • 23
  • 173
  • 212