Smarty-3.x模板中图片、CSS、JS的路径怎么替换
Smarty-3.x模板中图片、CSS、JS的路径如何替换?
比如说index.dwt模板文件里面有句代码:
也许你会认为这个图片可以显示出来,但是打开http://localhost/index.php,发现图片并未显示,图片的路径变成了http://localhost/images/logo.gif,而真正的路径应该是http://localhost/themes/default/images/logo.gif。还有模板文件里的js、css的路径都需要替换。
Smarty-3.x版本中该如何替换,把替换函数写在哪个位置上?
(Smarty-2.x的版本我知道,只是不知道Smarty-3.x版本的替换)
希望各位大哥帮忙一下!
------解决方案--------------------
Smarty-3.x 也还有这种问题么?
------解决方案--------------------
将路径赋给变量,src中直接写变量+文件名:
- PHP code
1 2 3 4 5 6 7 8 9 10 11 |
|

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The reasons why mysql cannot connect to localhost are that the mysql service is not started, the mysql port is occupied, and there is a problem with the MySQL configuration file. Detailed introduction: 1. In Windows systems, you can open the service manager by entering "services.msc" at the command prompt, then find the mysql service and ensure that its status is "Running". In Linux systems, you can use the "services.msc" command to check and control the service status; 2. You can use the open command and so on.

Solution: 1. Check the running status of the server and make sure it is listening on the correct port; 2. Try to temporarily disable the firewall or security software, and then try to access localhost again; 3. Check the hosts file of the operating system to ensure that localhost is resolved correctly ; 4. Try to restart the network adapter or reconfigure the network connection; 5. Try to change the port used by the local server, or close other programs that occupy the same port; 6. Try to manually add the corresponding IP address and domain name in the hosts file, etc.

linux localhost means "computer host name". The host name is used to identify an independent computer on the network; the root in "root@localhost" represents the currently logged-in user. In Linux, the administrator account is root, and the user is root. Log in to the Linux machine as a user.

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

On August 29, Foton Motor held a gorgeous brand refresh conference, bringing a series of exciting news to the industry. The new logo, Auman Zhilan bottom battery replacement products and the new Xiangling Q car became the focus of the press conference. Foton Motor's new logo shows the company's ambitions for the future. Foton Motor said that this new logo symbolizes the renewal and vigorous development of the brand, marking the company's entry into a new stage of development. At the press conference, Foton Motor also launched the much-anticipated Auman Smart Blue bottom battery replacement product to bring users Here comes a more convenient and efficient use experience. At the same time, the newly launched Xiangling Q car series has also attracted a lot of attention. There are 4 models in total, with prices ranging from 167,800 yuan to 168,800 yuan, providing consumers with

With the Skyline, HMD Global is set to unveil a mid-range smartphone in the style of the Nokia Lumia 920 on July 10. According to the latest information from the leaker @smashx_60, the Lumia design will soon also be used for a tablet, which will be c

Oneofthecontestsheldby1839Awardsin2024wasspecialinthatsubmissionstoitweretobegeneratedbyartificialintelligenceratherthancreatedwithacamera.ItwasthiscontestthatpiquedthecuriosityofacertainMilesAstray.Insteadofus

Reasons and solutions for why iwatch only lights up the logo but does not turn on: 1. It is caused by insufficient power and cannot be turned on. You can put the back of the iwatch on the charger; 2. It is caused by system version problems. You can roll the system back to the stable version; 3. , caused by charger or charging cable failure, you can use another iwatch magnetic charging cable and another USB power adapter; 4. caused by hardware failure, it is recommended to go to a professional third-party testing machine for maintenance.
