首页 > 代码库 > Smarty 分页

Smarty 分页

1 <div id="pagelist" class="clearfix">
2     <a href="/canadian-sailing-team-p191117&preview=1&pager=1">First</a> //第一页
3     {if $pagerInfo.currentPage > 1} //如果当前页大于1,则有pre链接
4         <a href="/canadian-sailing-team-p191117&preview=1&pager=span>Pre</span></a>
5     {else}
6         <span>Pre</span>
7     {/if}
8 index+1} //index从0开始计数
10         <a href="/canadian-sailing-team-p191117&preview=1&pager={$pindex}"><span {if $pagerInfo.currentPage == $pindex} class="cur" {/if}>{$pindex}</span></a>
11     {/section}
12  {if $pagerInfo.currentPage < $pagerInfo.pageCount}//如果当前页小于总页数,则有next链接
13         <a href="/canadian-sailing-team-p191117&preview=1&pager=span>Next</span></a>
14     {else}
15         <span>Next</span>
16     {/if}
17     <a href="/canadian-sailing-team-p191117&preview=1&pager={$pagerInfo.pageCount}">Last</a>
18 </div>

Smarty 分页