Home > Backend Development > PHP Tutorial > Introduction to the development examples of common tools for PHP encapsulation and paging

Introduction to the development examples of common tools for PHP encapsulation and paging

黄舟
Release: 2023-03-15 13:32:02
Original
1355 people have browsed it

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:

1

2

3

4

5

6

7

8

9

10

11

12

13

<?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);

 

?>

Copy after login



##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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template