Maison  >  Article  >  développement back-end  >  万急用thinkphp在html模板里面图片路径如何调用

万急用thinkphp在html模板里面图片路径如何调用

WBOY
WBOYoriginal
2016-06-13 10:08:272479parcourir

万急用thinkphp在html模板里面图片路径怎么调用
myweb项目名称放在WEB目录下

thinkphp放在myweb下
入口文件:/index.php
模板放在:/Tpl/default/index/,如index.html
图片目录在:/Tpl/default/public/iamges/目录下,如logo.png
在index.html中用到logo.png图片,我给图片设置绝对路径:万急用thinkphp在html模板里面图片路径如何调用.
问题出现了:
我用:http://localhost/myweb/Tpl/default/index/index.html 图片可以正常显示,
但是要在入口文件运行http://localhost/myweb/index.php/index/index/,图片就是不显示,
当然,这两种访问方式,页面内容是可以正常显示的,就是图片显示问题,还有CSS也调用不到了


------解决方案--------------------
在页面万急用thinkphp在html模板里面图片路径如何调用这样用

要么你就设置虚拟主机

http://www.myweb.com => http://localhost/myweb

然后在页面这样用万急用thinkphp在html模板里面图片路径如何调用

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn