?
本文檔使用 PHP中文網(wǎng)手冊 發(fā)布
If a variable is used frequently throughout your templates, applying the default modifier every time it is mentioned can get a bit ugly. You can remedy this by assigning the variable its default value with the assign function.
如果一個(gè)變量在你的整個(gè)模板里被經(jīng)常使用,而當(dāng)你每次要用到這個(gè)變量的時(shí)候就給它賦默認(rèn)的值,那將是無法忍受的。你可以通過使用 assign[賦值]這個(gè)函數(shù)來給這個(gè)變量賦上它的默認(rèn)值來你補(bǔ)救。
Example 18-2. Assigning a template variable its default value 例 18-2.賦給一個(gè)模板變量默認(rèn)的值
|