Instantiate page code
1. Time code: {$vo. createtime|todate=###, ' y-m-d h:i:s '}
2. Connection: {: U (' Pro/arr ')} such as: <form action= "{: U (' Pro/arr ')}" name= "form" method= "POST" >
Connections in the PHP page
URL ('service-pro/arr'= URL ('service-pro/arr').' &p= '; // 5. Define the connection
Query statement $where['status']='1';
$where['name']='Baidu'; $list= $mwhere($where),Select(); and a few other1.$where='and status =1';2.$where['Status']='1';3. $list = $mwhere('Status=1'),Select(); 4.$where['title'] = Array (' like','%'. $title.'%');
Write your own pagination code
Publicfunction arr () {$m= M ('problem');//0. Basic conditions$pagesize ='1'; $p= $_get['P']; if(Empty ($_get['title']) {$title="'; }Else{$title= $_get['title']; } $where['title'] = Array (' like','%'. $title.'%');//1. Query Criteria$where['Status'] ='1'; $totalNum= $mwhere($where)->count ();//2. A total of several data$totalpage = Intval ($totalNum/$pagesize);//3. Calculate pagination [Total pages]$totalp = $totalNum%$pagesize; if($totalp! =0) {$totalpage+=1; } $nowpage= $p;//4. Paging 4 Nodes "current page, previous page, next page, end" if($p <=1) {$nowpage='1'; } $nowsize= $nowpage * $pagesize-$pagesize;//[Current number of articles]$firstpage=1; $prevpage= $nowpage-1;//[prev] if($prevpage <=$nowpage) {$prevpage=$nowpage; } $nextpage= $nowpage +1;//[Next Page] if($nextpage >=$totalpage) {$nextpage=$totalpage; } $lastpage= $totalpage;//[Last]$url= URL ('Service-pro/arr').'&title='. $title.'&p=';//5. Define the connection$page='<a class= "A1" > Total'. $totalNum.'Bar Current'. $nowpage.'/'. $totalpage.'page </a>'; $page.='<a href= "'. $url. $firstpage.'"> first page </a>'; $page.='<a href= "'. $url. $prevpage.'"> Prev </a>'; $page.='<a href= "'. $url. $nextpage.'"> Next </a>'; $page.='<a href= "'. $url. $lastpage.'"> Last </a>'; $list= $mwhere($where)->limit ($nowsize, $pagesize)->order ('createtime desc'),Select(); $ This->assign ('Ser_title', $title); $ This->assign ('page', $page); $ This->assign ('List', $list); $ This-display (); }