This article mainly introduces the implementation of smarty simple paging, and describes the complete implementation process of smarty paging with a specific instance, for more information about how to implement smarty simple paging, see the examples in this article. The specific implementation method is as follows:
The following is the smarty code in the template. You can simply use smarty to replace the relevant variables. It is very simple, but you need to input the page parameter in the php code. I think this is quite simple. I like smarty more and more.
The Php code is as follows:
The Code is 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}
Homepage
{Else}
Homepage
{/If}
{If $ pageNum eq $ pageCount}
Last page
{Else}
Last page
{/If}
{/If}
({$ PageCount} pages in total)
Here is just an idea. In fact, paging is not that complicated.
I hope this article will help you with PHP programming.