数据分页:
代码语言:javascript复制 $Data = M('Channel'); // 实例化Data数据模型
$content = $Data->page($page, 4)->select();
$totalCount = $Data->count();
$this->assign('contents', $content);
$this->assign('totalPageCount', $totalCount);
$this->display();
视图:
代码语言:javascript复制 <volist name="contents" id="vo">
{$vo.id}--{$vo.title}<br/>
</volist>
代码语言:javascript复制 {:getPagination($totalPageCount,4)}