我正在我的本地主机上开发一个基于 drupal 的网站。我的网址有问题。
对于这样的网址:
http://localhost:81/my_website/library
我必须以这种方式输出图像 src:
<img src="<?php print $directory; ?>/image/header/headerR.png"/>
但是当上面的 url 改成这个
http://localhost:81/my_website/library/
我必须以这种方式输出图像 src:
<img src="../<?php print $directory; ?>/image/header/headerR.png"/>
我的意思是它必须提到父母。我的网站有上下文过滤器,可以在library/之后插入。是否有任何通用解决方案来处理此类事情?