Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Drupal 在php字段中呈现图像视图_Drupal_Drupal 8_Drupal Views - Fatal编程技术网

Drupal 在php字段中呈现图像视图

Drupal 在php字段中呈现图像视图,drupal,drupal-8,drupal-views,Drupal,Drupal 8,Drupal Views,我需要在ViewsGUI中使用php字段。我把它都设置好了,但我就是不能渲染我的图像。使用$row->field_image时,我得到一个包含[0]=>152的数组。那是什么?这就是图像的实体吗 我将如何在那里渲染我的图像?事实上,只需图像样式的url就可以了。这是Drupal 8。因为这只是一些基本的验证,我最终使用了twig,它工作得非常好。在“自定义文本”字段中,显示如下内容: {% if field_image_item|trim is not empty %} <img s

我需要在ViewsGUI中使用php字段。我把它都设置好了,但我就是不能渲染我的图像。使用$row->field_image时,我得到一个包含[0]=>152的数组。那是什么?这就是图像的实体吗


我将如何在那里渲染我的图像?事实上,只需图像样式的url就可以了。这是Drupal 8。

因为这只是一些基本的验证,我最终使用了twig,它工作得非常好。在“自定义文本”字段中,显示如下内容:

{% if field_image_item|trim is not empty %}
   <img src="{{ field_image_item }}" alt="{{ title }}">
{% elseif field_image_item_1|trim is not empty %}
   <img src="{{ field_image_item_1 }}" alt="{{ title }}">
{% endif %}
{%if field_image_item|trim不为空%}
{%elseif字段_图像_项目_1 |修剪不为空%}
{%endif%}
我想下次我会考虑如何在php中实现它:/