Cakephp页面分页

时间:2013-09-04 13:22:29

标签: php cakephp pagination

我创建了自己的dataSource,使用API​​收集数据。

现在我正在尝试使用paginate函数来获取数据。这工作正常我得到了正确的数据但是有问题!

我根本无法让分页器识别页面。我的目标是确保页面只有50条记录,但无论我做什么,我只能获得 ONE 页面,而且我的链接不正确,它们基本上只是文字

以下是我的观点:

index.ctp

<?php

    $this->Paginator->options(array(
        'update' => '#updateTable',
        'evalScripts' => true,
    ));
    ?>



        <!-- BEGIN EXAMPLE TABLE PORTLET-->
<div id="updateTable">

        <div class="portlet box green Report index">
        <div class="portlet-title">
                </tr>
                </thead>
                <tbody class="report_data">
                <?php foreach ($table['Report']['data']['data'] as $res): ?>
                    <tr>
                        <td><?php echo h($res['Offer']['name']); ?>&nbsp;</td>
                        <td><?php echo h($res['Stat']['clicks']); ?>&nbsp;</td>
                        <td><?php echo h(round($res['Stat']['conversions'], 2)); ?>&nbsp;</td>
                        <td><?php echo "€ " . h(round($res['Stat']['payout'], 2)); ?>&nbsp;</td>
                        <td><?php echo h(round($res['Stat']['ltr'], 2)) . " %"; ?>&nbsp;</td>
                        <td><?php echo "€ " . h(round($res['Stat']['cpc'], 2)); ?>&nbsp;</td>
                    </tr>
                <?php endforeach; ?>
                </tbody>
            </table>
            <div>
                <div class="paging">
                    <?php
                    echo $this->Paginator->numbers(array('first' => 'First page'));
                    echo $this->Paginator->prev('< Prev', null, null, array('class' => 'disable'));
                    echo $this->Paginator->next('Next >', null, null, array('class' => 'disable'));
                    ?>
                </div>
            </div>
        </div>
    </div>
</div>

值得一提的是我正在使用Ajax进行分页(如果这很重要) 还值得一提的是,用于收集数据的API确实支持分页,但我无法找到有关如何使用paginator

“使页面成本化”的任何文档

有没有人知道我做错了什么或知道我如何解决这个问题?

0 个答案:

没有答案
相关问题