Home > Article > Backend Development > Introduction to the development examples of common tools for PHP encapsulation and paging
This is a detailed introduction to the commonly used PHP encapsulated paging tool class, which has certain reference value. Paging is basically used in every project, so encapsulate it into a tool class and call it directly in the future. (Although TPFramework is very powerful, it is not a bad idea to block one yourself.) This saves time and effort and earns 'work points'.
#Step 1: Download Commonly used PHP packaging paging tools that we need to use in this lesson: http://www.php.cn/xiazai/leiku/420 Step 2: After the download is completed, find the PHP class file and unzip it Go to the local server and create a new php file! Step 3: We call this class in this new file and instantiate this class:
<?php include_once "page.php";//引入类文件 $obj = new page(); //实例化 $pageNum= 5; $pageCount= 5; $url=""; $Count = 5; $selected = false; //输出 echo $obj->showPage($pageNum,$pageCount,$url,$Count = 5,$selected = false); ?>
##The running results are as shown below:
The above is the detailed content of Introduction to the development examples of common tools for PHP encapsulation and paging. For more information, please follow other related articles on the PHP Chinese website!