TYPO3-Fluid返回字符串"array"(字符串) [英] TYPO3 - Fluid returns the string "array"

查看:104
本文介绍了TYPO3-Fluid返回字符串"array"(字符串)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的模板中有这个

<v:iterator.explode content="<f:format.nl2br>{artnumbers.qualitynumber.certificates}</f:format.nl2br>" glue="<br />" as="expCertificates">


如果artnumbers.qualitynumber.certificates为空,则返回字符串"array".

if artnumbers.qualitynumber.certificates is empty, it returns teh string "array".

那是个错误吗?

推荐答案

您正在使用< f:format.nl2br> ViewHelper.此ViewHelper用
标记替换字符串(!)中的换行符.您不能将其用于数组,这就是为什么它返回"array"的原因.

You are using the <f:format.nl2br> ViewHelper. This ViewHelper replaces newlines in a string (!) with
tags. You cannot use it for an array and that's why it returns "array".

我不知道为什么需要爆炸viewHelper.您为什么不只遍历证书?

I don't know why you need the explode viewHelper. Why don't you just iterate through your certificates?

<f:for each="{artnumbers.qualitynumber.certificates}" as="certificate">
    {certificate}<br />
</f:for>

编辑:如果证书是包含换行符的字符串,请使用换行符作为爆炸的粘合剂:

EDIT: If certificates is a string containing newlines, use the newline as glue for explode:

<v:iterator.explode content="{artnumbers.qualitynumber.certificates}" glue="\n" as="expCertificates">

您还可以尝试按照ViewHelper文档中的建议在胶中使用CONSTANT:LF.

You could also try to use CONSTANT:LF in glue as suggested in the documentation of the ViewHelper.

这篇关于TYPO3-Fluid返回字符串"array"(字符串)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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