1. 程式人生 > >thinkphp實現陣列分頁示例

thinkphp實現陣列分頁示例

public function nodeslist(){
$portal = new PortalApi;
$nodelist = $portal->getNodeLists($this->uid);

$count = count($nodelist['data']);
$p = new Page($count,10);
$lists = array_slice($nodelist['data'], $p->firstRow,$p->listRows);
$page = $p->show();
$this->assign('page',$page);
$this->assign('nodes',$lists);
$this->display(); 
 }

http://www.jb51.net/article/48964.htm