我有一个速度模板#foreach
循环,它没有从我试图从它获取它们的对象返回预期属性:ppcThemeData对象中的competitorAttributes
:
#set($ppcThemeData = {
"competitorAttributes": [
"Save up to 40%",
"Set price of $116",
"6 attractions from a choice of 9",
"3 predetermined attractions",
"Voucher by mail or print",
"Visit attractions for up to 9 days",
"No Hop-On Hop-Off bus tour"
]
}
})
循环遍历每个属性,创建一个列表项。但是,此循环不返回<ul>
内的任何内容。它也没有在控制台中引发任何错误,并且页面加载没有任何问题。
<ul>
#foreach($competitorAttribute in $pageTheme.competitorattributes)
#set($index = $velocityCount - 1)
<li><span>$competitorAttribute</span></li>
#end
</ul>
答案 0 :(得分:0)
$pageTheme.competitorattributes
必须是:$pageTheme.competitorAttributes
- A 需要是驼峰式的。