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