跳过内容

{nocache}

{nocache} 用于禁用模板部分的缓存功能。每个 {nocache} 都必须与匹配的 {/nocache} 配对。

注意

确保未缓存部分内使用的任何变量在从缓存加载页面时也已从 PHP 分配。

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

上面的代码将在缓存页面中输出当前日期。

另请参阅 缓存部分