drupal image path

前提是你 提交于 2019-12-08 12:46:25

问题


i created a page content type, and put this code in it. and set the input style to php.why the image can't show. i test it on my localhost.

       <img src="<?php echo $bath_path; ?>/images/1.jpg">

回答1:


Drupal way:

$path2file = base_path().'/images/1.jpg'; // If image located in {drupal root}/images. If image located in files directory, use file_directory_path() to get this path
print theme('image', $path_to_file, t('Image altername name'), t('Image title'));


来源:https://stackoverflow.com/questions/5151618/drupal-image-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!