gpt4 book ai didi

cakephp - Cake php默认分页获取首页和末页分页链接

转载 作者:行者123 更新时间:2023-12-01 04:35:05 25 4
gpt4 key购买 nike

如何让Cake php默认分页获取第一页和最后一页分页链接

<p>
<?php
echo $this->Paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?> </p>

<div class="paging">
<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class' => 'disabled'));?>
| <?php echo $this->Paginator->numbers();?>
|
<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
</div>

这将输出

Page 1 of 89, showing 15 records out of 1326 total, starting on record 1, ending on 15

<< previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | next >>

如何使用默认分页获取第一页和最后一页链接

first | << previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | next >> | last

最佳答案

我试过这段代码,它在 cakephp 1.3 中对我有效:--

<?php echo $this->Paginator->first(__('<< First', true), array('class' => 'number-first'));?>
<?php echo $this->Paginator->numbers(array('class' => 'numbers', 'first' => false, 'last' => false));?>
<?php echo $this->Paginator->last(__('>> Last', true), array('class' => 'number-end'));?>

尝试实现这个...

这就是您要找的:--

        <?php echo $this->Paginator->first(__('First', true), array('class' => 'disabled'));?>
| <?php echo $this->Paginator->prev('<< ' . __('Previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $this->Paginator->numbers(array('class' => 'numbers', 'first' => false, 'last' => false));?>
| <?php echo $this->Paginator->next(__('Next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
| <?php echo $this->Paginator->last(__('Last', true), array('class' => 'disabled'));?>

enter image description here

关于cakephp - Cake php默认分页获取首页和末页分页链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10684644/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com