简体   繁体   English

FilesProcessor和viewhelper f:uri.image

[英]FilesProcessor and viewhelper f:uri.image

I added to a Fluidtemplate cObject a FilesProcessor: 我向Fluidtemplate cObject添加了一个FilesProcessor:

dataProcessing {
  10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
  10.references.fieldName = media
}

in my fluid template i get the correct files object: 在我的流体模板中,我得到了正确的文件对象:

0 => TYPO3\CMS\Core\Resource\FileReferenceprototypeobject
1 => TYPO3\CMS\Core\Resource\FileReferenceprototypeobject

This works: 这有效:

<f:for each="{files}" as="file" iteration="i">
    <img src="{f:uri.image(image: file, width: '967c', height: '967c')}" alt="">
</f:for>

but this throws an exception: 但这会引发异常:

<img src="{f:uri.image(image: files.0, width: '967c', height: '967c')}" alt="">

Does anyone know why? 有人知道为什么吗? When i debug it with d:debug i get for file the foreach exact the same output like files.0 without foreach. 当我用d:debug调试时,我得到foreach文件,与没有filed.0一样,输出的文件完全相同。

Thanks! 谢谢!

Your inline notation not working because of you pass null value in notation. 您的内联表示法不起作用,因为您在表示法中传递了null值。 because of files.0 output is null 由于files.0输出为null

You store image as object. 您将图像存储为对象。 so you can't get this fields value like files.o see below screenshot. 因此您无法获得该字段值(例如files.o请参见下面的屏幕截图。 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM