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.