This article mainly introduces the method of rewriting the jump prompt page in TP5, and analyzes the modification steps and related operation precautions of thinkPHP5 jump prompt page in the form of examples. Friends in need can refer to the following
The example of this article describes the method of rewriting the jump prompt page in thinkPHP5 (TP5). Share it with everyone for your reference, the details are as follows:
Everyone knows that the successful and failed execution pages of the Tp framework have not been particularly good-looking, but this also gives developers a good choice. We can use Rewrite this jump prompt page according to your own preferences
I use the Tp5 framework. The rewriting of the jump prompt page of Tp5 is similar to that of Tp3. First, let’s take a look at the built-in Tp framework. I directly pasted the code for the jump prompt page:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
Let’s rewrite it below. First of all, the css can be deleted directly, which is almost It has no effect. I forgot to mention that the replacement jump prompt I use is the layer plug-in. This plug-in does a good job. The official website: http://layer.layui.com/. If you want to see it, please turn left.
1. Download the layer plug-in and decompress it. The decompressed file package is as follows:
After decompression, it contains these three main files, of which we need What is introduced into the file is layer.js
But don’t forget to introduce jquery.js
Then let’s take a look at a few more important lines of code in Tp’s original code:
1 2 3 |
|
These three points are prompt information, jump path, and waiting time
With these, you can use hidden fields when rewriting The technique is to use hidden fields to obtain the required information in the form of jquery, and then insert it into the following js:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Rewritten js:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Here I did not use automatic jump, but manually clicked to jump, so the following timer was deleted directly and did not affect
The rewriting was successful
Related recommendations:
An example of TP5 implementing email sending service encapsulation and sending attachments
The above is the detailed content of TP5 implements the method of rewriting the jump prompt page. For more information, please follow other related articles on the PHP Chinese website!