Sometimes it may be that the path is different from the offline. It would be similar to writing
//某个.php文件
main.css" rel="stylesheet">
But I was thinking, oh, sometimes you have to make the site static. So that's not going to work? If you want to make the Web page static, how to solve the problem of the line offline path different? What is the easiest way to solve this problem? Just like the Jade Direct template in node. js?
Also is if a page nested a lot of such tags will make the page load efficiency is lower?
Just learned PHP soon qaq. Not a wide range of insights. Ask for explanations
Reply content:
Sometimes it may be that the path is different from the offline. It would be similar to writing
//某个.php文件
main.css" rel="stylesheet">
But I was thinking, oh, sometimes you have to make the site static. So that's not going to work? If you want to make the Web page static, how to solve the problem of the line offline path different? What is the easiest way to solve this problem? Just like the Jade Direct template in node. js?
Also is if a page nested a lot of such tags will make the page load efficiency is lower?
Just learned PHP soon qaq. Not a wide range of insights. Ask for explanations
Like this HTML-filled PHP tag running speed is actually very fast, the speed effect can be completely ignored.
So you can write a config.php, declare the various paths inside.
Like what
You can then use the. htaccess auto include or manually include this file. This way, you can update the path of the entire project as long as you change the config.php.
As long as you don't have an antique version of PHP that supports short tags, you can write it short:
If you're upset, you can write your own script. All the constants are replaced with the desired address, and it's good to run it again when you redeploy.
Just saw you again asked how the whole update is like compiling.
To say a stupid way, replace the entire project folder search with the one you want.
At the time of development, fill it out , copy the code all over when you deploy it, and replace each variable with a script.
The main purpose is to improve the migration of code and some development problems.
Like saying you can use one to represent installed, why do you have to use a constant to express it?
1. Improve readability
2. Although the standard fixed can not be changed, but also have to change the time, then if the use of 1 is estimated to be able to change you want to die.
The same problem.