How to replace the path of images, CSS and JS in the Smarty-3.x template?

Source: Internet
Author: User
In the Smarty-3.x template image, CSS, JS path how to replace? For example, index. the dwt template file contains the following code: & lt; imgsrc = & quot; images/logo.gif & quot; width = & quot; 100 & quot; height = Smarty-3.x template in the image, CSS, JS path how to replace?
For example, the index. dwt template file contains the following code:

You may think this image can be displayed, but open http: // localhost/index. php: The image is not displayed. the path of the image is changed to http: // localhost/images/logo.gif, and the actual path is http: // localhost/themes/default/images/logo.gif. In addition, the js and css paths in the template file must be replaced.

How should I replace the replacement function in the Smarty-3.x version?
(The version of the Smarty-2.x I know, just don't know the replacement of the Smarty-3.x version)

Hope you guys can help me!


------ Solution --------------------
Smarty-3.x also has this problem?
------ Solution --------------------
Assign the path to the variable. in src, directly write the variable + File name:
PHP code
  Logo.gif "border = 0/>
------ Solution --------------------
Set a basepath constant and modify it as needed.
------ Solution --------------------
The landlord should be asleep.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.