這是我的選擇表如何使用find在cakephp中分頁?
id | question_id | content
1 1 bee
2 1 fly
3 1 dog
4 2 cat
5 2 bat
6 2 wasp
,這是我的問題表
id | content
1 question1
2 item2
這是我did.With這我可以顯示我想要做的choices..what問題現在,是到分頁它,更像是每page.How 1個問題要做到這一點?你的幫助會大大appreciated.Thanks
$options['fields'] = array('questions.id','questions.content');
$options['joins'] = array(
array(
'table' => 'generated_exam_items',
'alias' => 'GenExamItems',
'type' => 'inner',
'conditions' => array(
'GenExamItems.generated_examination_id' => 25
)
),
array(
'table' => 'questions',
'alias' => 'Questions',
'type' => 'inner',
'conditions' => array(
'Questions.id = GenExamItems.questions_id'
)
),
);
$options['conditions']=array('GenExamItems.generated_examination_id' => 25,'Question.id=GenExamItems.questions_id');
$question_detail = $this->Question->find('all',$options);
$this->set('questions',$question_detail);
可能重複[如何獲得每個項目的選擇,在CakePHP的表?](http://stackoverflow.com/questions/16538412/how-to-get-choices-of-each-item -in-a-table-in-cakephp) – Tommy