drupal图像路径 [英] drupal image path

查看:127
本文介绍了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天全站免登陆