TYPO3:使用fluid的日期视图助手内联作为翻译视图助手的参数

Chr*_*off 3 typo3 fluid view-helpers

我目前正在开发一些在TYPO3 6中使用的扩展.

在一个视图中,我有包含日期​​字段的数据库记录.我可以输出以下日期值:

<f:format.date format="d.m.Y H:i:s">{record.validend}</f:format.date>
Run Code Online (Sandbox Code Playgroud)

但是,我需要一个已翻译的消息,所以我想使用translate视图助手并将格式化的日期放在arguments属性中.到目前为止没有成功.

我试过了:

<f:translate key="{msg_id}" arguments="{0: code, 1: {f:format.date(date: record.validend, format: 'd.m.Y H:i:s')}}" htmlEscape="0" />
Run Code Online (Sandbox Code Playgroud)

…和…

<f:translate key="{msg_id}" arguments="{0: code, 1: {record.validend -> f:format.date(format: 'd.m.Y H:i:s')}}" htmlEscape="0" />
Run Code Online (Sandbox Code Playgroud)

...遵循本指南:http://forge.typo3.org/projects/typo3v4-mvc/wiki/Fluid_Inline_Notation

但是,我的符号中似乎存在一些语法错误,迫使流体将整个事物解释为字符串,从而导致错误,导致参数attribut应该是一个数组.

谁能告诉我,我想要的是什么,我需要什么语法?

最好的祝福

基督教

stm*_*llr 9

您需要使用反斜杠来转义格式的引号.

解决方案是:

<f:translate key="{msg_id}" arguments="{0: code, 1: '{f:format.date(date: record.validend, format: \'d.m.Y H:i:s\')}'}" htmlEscape="false" />
Run Code Online (Sandbox Code Playgroud)