2013-03-04 54 views
1

我在將模板包含在另一個模板中時遇到了問題。我希望smarty每次刷新時都加載新鮮的tpl,而不是從緩存或templates_c中顯示它。當我對goggled並檢查了我在下面找到的解決方案時,但它不列入似乎我case.I工作確實使用的Smarty版本2Smarty Cache問題

{包括文件=「$theme/$content」 NOCACHE}

請出示一些輕

回答

0

使用這樣的代碼建設爲你在你的例子中提供的可用Smarty 3 (li nk to docs:http://www.smarty.net/docs/en/language.function.include.tpl

在Smarty 2中,您不能使用nocache選項,但您可以嘗試使用其他選項。例如$smarty->caching = 1

看看Smarty 2的文檔頁面:http://www.smarty.net/docsv2/en/caching.tpl

+0

感謝您的參考。如何在smarty.for中的{insert}函數中使用tpl。它顯示錯誤{insert file.tpl} http://www.smarty.net/docsv2/en/language.function.insert.tpl。請讓我知道這個好方法 – user1965773 2013-03-04 12:08:39