drupal 图像路径 [英] drupal image path

查看:18
本文介绍了drupal 图像路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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">

推荐答案

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

这篇关于drupal 图像路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆