我使用trimpath library繪製動態頁面如何在trimpath中添加if子句條件的表達式?
我試圖表達增加,如果條款
{for item in itemsObj}
{if item_index % 4 == 3 && peopleObj.length != item_index + 1 }
<div class="search-result-row" style="border-bottom:1px solid #dadada;">
{/if}
{/for}
但價值「item_index + 1」不作爲數學表達式,結果此值計算的pinding字符串 例如 如果item_index = 3那麼表達式的結果是= 31
請問您能幫我解答嗎?
你嘗試'(item_index + 1)'? – jbabey
是的,我嘗試這個仍然把結果作爲字符串綁定 –