PHP计数分页 [英] PHP counting pagination

查看:63
本文介绍了PHP计数分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
目前,我正在尝试计数和编号分页系统.
实际上,脚本正在与构建的下一个上一个分页一起使用,现在需要计数分页.
页面上有变量结果$ page,它是由具有可用页面数的远程API返回的,因此这里是类摘要,如果有人愿意将其用于编号分页

Hello
Currently I am trying count and numbering pagination system.
Actually script is working with built next prev pagination and now need counting pagination.
There is on page variable result $page and it is returned by a remote API with the number of pages available so here is the class snipet and if someone is willing to adopt this into numbering pagination

<div class="pagination">
	<div class="pagi"><?=_RESULTS?>: <span class="query"><?=$tag?></span></div>
	<? if ($service->pagination()): ?>
	<div class="pagd">
		<? if ($page > 1): ?>
		<a href="<?=BASE_URL?>/<?=$op?>/tag/<?=$tag?>/<?=($page-1)?>.html">« <?=_PREVIOUS?></a> 
		<? endif; ?>
		<?=_PAGE?> <span class="pagnumtop"><?=$page?></span> 
		<a href="<?=BASE_URL?>/<?=$op?>/tag/<?=$tag?>/<?=($page+1)?>.html"><?=_NEXT?> »</a>
	</div>
	<? endif; ?>
	<div style="clear: both"></div>
</div> 

推荐答案

页面,它由远程API返回,并带有可用的页面数,因此这是类摘要,如果有人愿意将其用于编号分页
page and it is returned by a remote API with the number of pages available so here is the class snipet and if someone is willing to adopt this into numbering pagination
<div class="pagination">
	<div class="pagi"><?=_RESULTS?>: <span class="query"><?=


tag ?> < /span > < /div > <? 如果(
tag?></span></div> <? if (


服务->分页( )):?> < div =" pagd" <? 如果(
service->pagination()): ?> <div class="pagd"> <? if (


这篇关于PHP计数分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆