In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you "how to use smarty", the content is simple and easy to understand, the organization is clear, I hope to help you solve doubts, let Xiaobian lead you to study and learn "how to use smarty" this article.
Can be set in display
$smarty->display("demo.tpl",$_SERVER[REQUEST_URI]) to implement multiple caches for a template.
Now that the file has been cached, we can go to cache the file, without loop execution of the connection database, query. Use a function in smatry to judge
$smarty->iscached(demo.tpl"",",$_SERVER[REQUEST_URI]) The default value is"true"where the template is the same as the display.
There is a difference between smarty3 and smarty2.
$smarty->is_cached(demo.tpl"",",$_SERVER[REQUEST_URI]) smarty2
$smarty->iscached(demo.tpl"",",$_SERVER[REQUEST_UR]I) smarty3
However, there are some parts in the template that do not need to be cached, such as: user login, and comments on the article do not need to be cached, so we solve this problem.
1, in the php file, if the data does not need to be cached, it should be placed outside the iscached judgment.
2. In the template, if you don't need to cache the part, put it in... between.
That's all for "how to use smarty". Thanks for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.