OpenSNS开发笔记(1)

时间:2021-03-02 06:31:24

数据分页:

        $Data = M('Channel'); // 实例化Data数据模型

        $content = $Data->page($page, 4)->select();
$totalCount = $Data->count(); $this->assign('contents', $content);
$this->assign('totalPageCount', $totalCount); $this->display();

视图:

            <volist name="contents" id="vo">
{$vo.id}--{$vo.title}<br/>
</volist>
            {:getPagination($totalPageCount,4)}