dedecms織夢(mèng)在runphp里
用php默認(rèn)的時(shí)間格式函數(shù)計(jì)算,一個(gè)小例子,公司成立那一年與今年有多少年了
[field:clsj runphp=yes]@me = (empty(@me) ? "" : "成立年限:<span class='orange'>".(date("Y",time())-@me)."</span> 年");[/field:clsj]
還可以用雙引號(hào)斷開(kāi)和拼接的方式,例如
{dede:list pagesize='10'}
[field:array runphp=yes]
($GLOBALS[autoindex]==1) ? @me="<li><a href='{@me['arcurl']}' class='preview'><img src='{@me['litpic']}'/></a><a href='{@me['arcurl']}' class='title'>{@me['title']}</a><span class='info'><small>日期:</small>".GetDateTimeMK(@me['pubdate'])."<small>點(diǎn)擊:</small>{@me['click']}<small>好評(píng):</small>{@me['scores']}</span><p class='intro'>簡(jiǎn)介:{@me['description']}</p></li>":@me="<li><a href='{@me['arcurl']}' class='title'>{@me['title']}</a><span class='info'><small>日期:</small>".GetDateTimeMK(@me['pubdate'])."<small>點(diǎn)擊:</small>{@me['click']}<small>好評(píng):</small>{@me['scores']}</span><p class='intro'>簡(jiǎn)介:{@me['description']}</p></li>";[/field:array]
{/dede:list}