drupal图像路径

时间:2011-03-01 07:29:38

标签: drupal drupal-6

我创建了一个页面内容类型,并将此代码放入其中。并将输入样式设置为php.why图像无法显示。我在我的localhost上测试它。

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

1 个答案:

答案 0 :(得分:3)

Drupal方式:

$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'));