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

{nocache}

{nocache} は、 テンプレートの特定の部分のキャッシュを無効にします。 {nocache} は、必ずそれに対応する {/nocache} とペアで使わなければなりません。

注意

キャッシュしない部分で使ったすべての変数は、 ページがキャッシュから読み込まれるときに PHP にも代入されます。

Example 7.57. テンプレートの特定の部分のキャッシュを回避する



Today's date is
{nocache}
{$smarty.now|date_format}
{/nocache}

   

上のコードは、キャッシュしたページに現在の日付を出力します。


キャッシュ の節も参照ください。