The example of this paper describes the implementation of Smarty simple paging, shared for everyone to reference. The implementation method is as follows:
The following is the template of the Smarty code, with Smarty simple to enter the relevant variables on the line, very simple, but also in the PHP code to pass the page this parameter. I think this is very good, very simple. I'm more and more fond of using smarty.
The PHP code is as follows:
Copy the Code Code as follows: {if $pageCount > 1}
{foreach item=i from= $pagerList}
{if $pageNum eq $i}
{$i}
{Else}
{$i}
{/if}
{/foreach}
{if $pageNum eq 1}
Previous page
{Else}
Previous page
{/if}
{if $pageNum eq $pageCount}
Next page
{Else}
Next page
{/if}
{if $pageNum eq 1}
Home
{Else}
Home
{/if}
{if $pageNum eq $pageCount}
Last page
{Else}
Last page
{/if}
{/if}
(Total {$pageCount} page)
Here just give a thought, actually the pagination is not so complicated.
I hope this article is helpful to everyone's PHP programming.