所有的smarty模板標籤都被加上了定界符. 預設情況下是 { 和},但它們是可被改變的.
例如,我們假定你在使用預設定界符. 在smarty裡,所有定界符以外的內容都是靜態輸出的,或者稱之為不可改變. 當smarty遇到了模板標籤,將嘗試解釋他們,然後再以恰當的方式輸出 .
模板注釋被*號包圍,例如 {* this is a comment *} smarty註釋不會在模板檔案的最後輸出中出現. 它只是模板內在的注釋.
例 3-1.注釋
{* Smarty *} {* include the header file here *} {include file="header.tpl"} {include file=$includeFile} {include file=#includeFile#} {* display dropdown lists *} <SELECT name=company> {html_options values=$vals selected=$selected output=$output} </SELECT>