這是我的解決方案。在你的控制器:
function index(){
// Your default model
$this->set('model1', $this->paginate());
// Pagination for model2
$this->set('model2', $this->paginate('Model2'));
}
在你看來:
// Display your model1 data, and then for prev and next
echo $paginator->prev($options = array('model' => 'Model1'));
echo $paginator->next($options = array('model' => 'Model1'));
// Display your model2 data, and then for prev and next
echo $paginator->prev($options = array('model' => 'Model2'));
echo $paginator->next($options = array('model' => 'Model2'));
點是輸入你的型號,以控制器的PAGINATE方法和分頁程序的鏈接方法(排序,上一個,下一個)。
從何種意義上說?兩個連接的結果集或兩個單獨的結果集? – 2010-08-03 10:02:39
兩個獨立的結果集。 – chustar 2010-08-14 20:09:07