我加入了显示多个表格的屏幕截图。我希望分页器可以处理多个“显示”表,尽管它们都来自同一个查询。请注意,“Id”列是众多列之一。
var $paginate = array(
'limit' => 1000);
function index() {
$this->Immeuble->recursive = 1;
$this->Immeuble->contain('Agence');
$this->set('results', $this->paginate());
$agences = $this->Immeuble->find('count', array('fields' => 'DISTINCT Agence.Nom'));
$this->set('agences',$agences);
$ii = 0;
$records = $this->Immeuble->find("all",array('fields'=>'Immeuble.id,Immeuble.image,Immeuble.description,Immeuble.start_date,Immeuble.end_date$
$this->set('records',$records);
}
在我看来,这是我的分页器部分:
<tr>
<th><?php echo $this->Paginator->sort('Id','id'); ?></th>
<th><?php echo $this->Paginator->sort('description');?></th>
<th><?php echo $this->Paginator->sort('start_date');?></th>
<th><?php echo $this->Paginator->sort('end_date');?></th>
<th><?php echo $this->Paginator->sort('image');?></th>
<th><?php echo $this->Paginator->sort('ordre');?></th>
<th><?php echo $this->Paginator->sort('agence_id');?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>