clear_compiled_tpl

clear_compiled_tpl -- 

void clear_compiled_tpl ( [string tpl_file [, string compile_id [, int exp_time]]])

This clears the compiled version of the specified template resource, or all compiled template files if one is not specified. if you pass a compile_id only the compiled template for this specific compile_id is cleared. if you pass an exp_time, then only compiled templates older than exp_time seconds are cleared, by default all compiled templates are cleared regardless of their age. This function is for advanced use only, not normally needed.

此函式在清除某樣版編譯後的檔案,或者是如果沒有指定某特定樣版的話,則清除所 有編譯後的檔案。如果你有指定 compile_id 的話,則只有此特定 compile_id 的編輯過的樣版 檔案會被清除,如果你有使用 exp_time 參數的話,則只有超過以秒為單位的 exp_time 參數的 編譯過的樣版檔案才會被清除。預設情況下,不會考慮編譯過後的樣版檔案存活的時間而將所有 編譯過後的檔案清除。此函式只建議進階使用者使用。

Example 13-1. clear_compiled_tpl

<?php
// clear a specific template resource
$smarty->clear_compiled_tpl("index.tpl");

// clear entire compile directory
$smarty->clear_compiled_tpl();
?>