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

説明

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

パラメータ

stringtemplateテンプレート名
stringcache_idキャッシュID/td>
stringcompile_idコンパイルファイルID
intexpire_timeファイルがこの時間より古い場合は削除する

テンプレートに複数のキャッシュがあった場合、 2番目のパラメタとしてキャッシュIDを指定することで、特定のキャッシュをクリアすることができます。 You can also pass a $compile_id as a third parameter. You can group templates together so they can be removed as a group, see the caching section for more information. 3番目のパラメタとしてコンパイルIDを指定することで、 グループとして取り除くことができるようにテンプレートを分類できます。 詳しい情報に関してはキャッシュ項を参照。 4番目のパラメタとしてキャッシュファイルを削除する前にそのファイルが存在しなくてはならない 最低限の時間(秒)を与える事が出来ます。

PHP

// clear the cache for a template
$smarty->clear_cache('index.tpl');

// clear the cache for a particular cache id in an multiple-cache template
$smarty->clear_cache('index.tpl', 'MY_CACHE_ID');

関連記事

スポンサーリンク

Softbankで絵文字を表示させる

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る