2

最初と最後のページのページ付けリンクを取得するためにCakephpのデフォルトのページ付けを取得する方法

<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
4

3 に答える 3

16

このコードを試してみたところ、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'));?>

ここに画像の説明を入力

于 2012-05-21T12:05:54.880 に答える
1

あなたの質問を正しく理解したかどうかはわかりませんが、ヘルプページを開くだけです。

PaginatorHelper :: first()

PaginatorHelper :: last()

于 2012-05-21T11:56:30.430 に答える