tp5移动端简单下一页、下一页 分页
<div class="m-pageList hidden-lg hidden-md">
{php}
$query = input('get.'); //当前页面参数
$path = $_SERVER['PATH_INFO']; //当前页面路径
//当前页面id
input('page')?$pid = input('page'):$pid = 1;
//移动page参数
if(isset($query['page'])){
unset($query['page']);
}
//其它get参数
$param = '';
foreach($query as $k=>$v){
if($v){
$param .= '&'.$k.'='.$v;
}
}
//页面总数
$total = $list->lastpage();
$prevId = $pid-1;
$nextId = $pid+1;
//上一页、下一页
$prevUrl = $nextUrl = false;
if($prevId>0){
$prevUrl = $path.'?'.'page='.$prevId.$param;
}
if($nextId<=$total){
$nextUrl = $path.'?'.'page='.$nextId.$param;
}
{/php}
<div class="prev"><a {if condition="$prevUrl eq false"} href="javascript:;" class="disabled" {else} href="{$prevUrl}" {/if} >上一页</a></div>
<div class="num">{$pid}/{$total}</div>
<div class="next"><a {if condition="$nextUrl eq false"} href="javascript:;" class="disabled" {else} href="{$nextUrl}" {/if} href="">下一页</a></div>
</div>