我是drupal的初学者。我想从drupal中的特定文件夹中提取图像。有没有什么办法直接从任何特定的自定义主题获取Drupal图像。从drupal的特定目录提取图像
0
A
回答
0
您应该只使用主题中的图片。你可以得到路径,你的主题是这样的:
$theme = drupal_get_path('theme',$GLOBALS['theme']);
把那即在使用主题图像模板文件的顶部。然后里面你的主题模板,你可以有这样的:
<img src="/<?php echo $theme; ?>/images/my_image.png">
如果您保存在里面images
目录你的主题图片...
+0
或至少我需要的是如何加载模块模块功能自定义主题的路径 –
0
如果成像路径上的本地文件系统中的数组是你想要的 - 使用这个代码,它应该做你需要的。获取sites/default/files/vegas
目录中的所有png jpg gif路径。
//We will use the stream wrapper to access your files directory
if ($wrapper = file_stream_wrapper_get_instance_by_uri('public://')) {
//Now we can easily get an actual path to that folder
$directory = $wrapper->realpath();
//Don't forget to append your "vegas" subfolder here
$directory .= DIRECTORY_SEPARATOR . 'vegas' . DIRECTORY_SEPARATOR;
$images = glob($directory . "*.{jpg,png,gif}", GLOB_BRACE);
foreach($images as $imagePath)
{
//Do your thing!
echo $imagePath;
}
}
相关问题
- 1. Android:从特定目录加载图像
- 2. 从目录集中提取特定的目录
- 3. 无法提取到特定目录
- 4. 从C#取Drupal图像#
- 5. 从webservice XML提取特定记录
- 6. 如何从目录中的html文件中提取图像?
- 7. 从图像中提取Gabor特征
- 8. 如何从.NET图标文件中提取特定图像?
- 9. PHP从一个目录中拉出特定的图像集
- 10. 显示图像从一个特定的目录
- 11. 从特定标记下的网页中提取图像
- 12. Drupal从子目录
- 13. 用PHP从目录中提取随机图像
- 14. 从子目录中读取图像
- 15. 从目录中抓取图像
- 16. 从同一目录读取图像?
- 17. Joomla - 从目录中获取图像
- 18. 从目录中读取图像
- 19. 从目录中随机获取图像?
- 20. PHP从子目录中获取图像
- 21. Matlab - 如何从目录读取图像
- 22. 使用htaccess从子目录中的根目录读取图像
- 23. 无法从特定目录显示图像IOS
- 24. 从目录中获取Drupal主题
- 25. 从特定图片中提取数字
- 26. 从指定目录中提取所有图像,然后显示它们
- 27. 在iOS中从相机胶卷中提取特定图像
- 28. 从图像中选择图像并获取返回的目录
- 29. Javascript从特定图像onclick获取.src
- 30. 从页面获取特定图像
我的意思是让图片的网址 –