0
我似乎無法得到正確的語法:divide maths calculation。Smarty 3數學計算
{assign var="span" value="`12/$rows|@count`"}
文檔 - http://www.smarty.net/docs/en/language.math.tpl
我似乎無法得到正確的語法:divide maths calculation。Smarty 3數學計算
{assign var="span" value="`12/$rows|@count`"}
文檔 - http://www.smarty.net/docs/en/language.math.tpl
試試這個:
{assign var="count" value=$rows|@count}
{math assign="span" equation='x/y' x=12 y=$count}
我不確定第一個表達式,但第二個表達式肯定會工作 –
我必須想盡語法可能的話,我認爲它不可能 –
你如何找到其網站性能Smarty做了很多預處理。對於爲什麼Smarty需要這麼多功能,我一直很困惑。 – Trent
因爲它與視圖/模板相關,我正在計算twitter引導的列數。再加上它與javascript的鏈接更容易。 –