include函數(shù)
include函數(shù)
如果設(shè)置了 assign 屬性,該屬性對(duì)應(yīng)的變量名用于保存待包含模板的輸出,這樣待包含模板的輸出就不會(huì)直接顯示了。
可以在屬性中傳遞參數(shù)給待包含模板. 傳遞給待包含模板的參數(shù)只在待包含模板中可見
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"}