数据分页:
$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)}