0
我有一个.twig文件,其中一些内容是通过下划线的模板引擎使用主干呈现的。跳转下划线的下划线模板语法
index.twig文件
<select name="" id="" class='select-specializations'>
<% _.each(itemList, function(item){%>
<option value="<%= item %>"> <%= item %> </option>
<%})%>
</select>
的问题是,树枝似乎并没有忽略这个<%
语法,当我在我的模板文件autoescape
。抛出以下错误:
A block must start with a tag name in..
如果我使用raw
块,下划线似乎并不在已了解语法。是否有解决分枝和下划线之间的语法冲突的问题?
看看http://stackoverflow.com/questions/11780974/using-loops-in-backbone-underscores-templates –
如果你想要Underscore来解析它,为什么要把它作为'twig'模板? –
@JonathanLonowski html页面是使用symphony生成的。 – Tushar