2011-03-04 21 views
0

我有5個不同的頁面下面的代碼:CakePHP的分頁程序出現異常行爲

<div class="pagination"> 
<p class="page-numbers textcenter"><?php $this->Paginator->numbers(); ?></p> 
<p class="prev-link"><?php echo $this->Paginator->prev('« Previous', null, null, array('class' => 'disabled')); ?></p> 
<p class="next-link"><?php echo $this->Paginator->next('Next »', null, null, array('class' => 'disabled')); ?></p> 
<p class="page textcenter"><?php echo 'Page '.$this->Paginator->counter(); ?></p> 
</div> 

但是它的表現有所不同每一頁上。下一個和上一個鏈接將出現在某些頁面上,但不會出現在其他頁面上,對於其他要輸出的內容則是相同的。

任何人都有任何想法,爲什麼發生這種情況?

回答

1

geoffs,

我檢查我產生意見一個給你,並且在關注線是:

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

有幾件事情進入腦海:

  1. 在哪裏你傳遞一個空它是一個空 數組
  2. 也許你不應該禁用類選項,如果你把你的鏈接在一個
  3. 一看負責CSS可能是值得
0

請刪除語法「«‘和’»」符號,然後再試一次