Get Smarty

Donate

Paypal

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

Name

clearCache() — 指定したテンプレートのキャッシュを破棄します。

説明

void clearCache(string template,
                string cache_id,
                string compile_id,
                int expire_time);
  • テンプレートに 複数のキャッシュ がある場合は、二番目のパラメータで cache_id を指定すると特定のキャッシュを破棄できます。

  • $compile_id を三番目のパラメータで渡すことができます。 テンプレートをグループ化 することもでき、それをグループ単位で削除することができます。詳細は キャッシュの節 を参照ください。

  • オプションの四番目のパラメータで、キャッシュを破棄するまでの最小経過時間 (秒単位) を指定することができます。

Example 13.8. clearCache()


<?php
// テンプレートのキャッシュを破棄します
$smarty->clear_cache('index.tpl');

// 複数キャッシュをもつテンプレートで、特定の ID のキャッシュだけを破棄します
$smarty->clear_cache('index.tpl', 'MY_CACHE_ID');
?>

   

clearAllCache() および キャッシュ の節も参照ください。

Comments
No comments for this page.

Advertisement

Sponsors [info]

Sponsors