doris20141022 2011-11-27 23:48
浏览 66
已采纳

cakephp增加分页页面显示

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'); ?>
  • 写回答

1条回答 默认 最新

  • douyan1613 2011-11-27 23:55
    关注

    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>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?