Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

clear_cache()

clear_cache() -- membersihkan cache untuk template tertentu

Deskripsi

void clear_cache ( string template [, string cache_id [, string compile_id [, int expire_time]]])

  • Jika anda mempunyai multipel cache untuk sebuah template, anda bisa membersihkan cache tertentu dengan menyertakan cache_id sebagai parameter kedua.

  • Anda juga bisa mengirimkan $compile_id sebagai parameter ketiga. Anda dapat mengelompokan template bersama agar bisas dihapus sebagai sebuah grup, lihat seksi cache untuk informasi lebih jauh.

  • Sebagai parameter opsional keempat, anda dapat menyertakan waktu minimum dalam detik cache file seharusnya sebelum dibersihkan.

Teladan 13-1. clear_cache()

clear_cache(\'index.tpl\'); // bersihkan cache untuk id cache tertentu dalam multipel-cache template $smarty->clear_cache(\'index.tpl\', \'MY_CACHE_ID\'); ?>'); ?>

Lihat juga clear_all_cache() dan seksi caching.