include函數(shù)
include函數(shù)
如果設(shè)定了assign 屬性,該屬性對(duì)應(yīng)的變數(shù)名稱用於保存待包含範(fàn)本的輸出,這樣待包含模板的輸出就不會(huì)直接顯示了。
可以在屬性中傳遞參數(shù)給待包含模板. 傳遞給待包含模板的參數(shù)只在待包含模板中可見(jiàn)
eg :
{*title,table_bgcolor會(huì)取代原有的title,table_bgcolor屬性*}
##{include file="header.tpl" title="Main Menu" table_bgcolor="#c0c0c0"}{* body of template goes here *}
{include file="footer.tpl"}
#