我在 Play 1.2.4 中定义了一个自定义标签,它呈现如下表格:
*{ in tagTable.html }*
<table>
<tr>
${_param1}
</tr>
<tr>
${_param2}
</tr>
<tr>
#{list items: _param3, as: 'item'}
<td>${item}</td>
#{/list}
</tr>
</table>
但是当调用站点将参数分成多行时,它会给我一个错误(每个参数可能有点长,所以我不希望所有参数都在一行中)。
The template /app/views/example.html does not compile :
illegal colon after argument expression; solution: a complex label expression before a colon must be parenthesized
调用站点如下所示:
#{tagTable
param1: 'this is some very long content for one line',
param2: 'this also is some long content',
param3: ['this', 'is', 'a', 'list', 'also']
/}
如果它们在一条线上就可以正常工作。允许标记定义跨行的语法是什么(或者我是否错误地传递了其他内容?)
最佳答案
这是一个已知错误,仅在 Windows 上(在 Play 的 1.2.4 版本中)会导致问题。这个BUG其实已经修复了,不过是下个版本的Play 1.2.5。
参见 https://play.lighthouseapp.com/projects/57987/tickets/107有关此错误的更多信息。
如果您需要尽快修复错误,那么您可以尝试从 github 下载最新的主版本。
关于java - Play framework 1.2.4 中的多行标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9086495/