Smarty If the value of the template is dynamic, generating the cache is also dynamic.

Source: Internet
Author: User
Smarty If the value of the template is dynamic, the generation of the cache is also dynamic Ah, why???


For example: $smarty->caching = true;
$smarty->cache_lifetime = 50100;
$showtime =date ("Ymdhms")
Set the cache file name
$smarty->assign ("Name", "Fred");
$smarty->assign ("Time", $showtime);



Template File receive $showtime page after the refresh this value has been changed Ah,,,, not the cache??
Why does it change??????


Reply to discussion (solution)

I use your code to find is normal, your smarty is what version?

I use your code to find is normal, your smarty is what version? In, the latest version,, left QQ,, my qq:81295663 ... Xie

I use your code to find is normal, your smarty is what version? I downloaded the latest version of!!!!!

I use your code to find is normal, your smarty is what version?

What is your normal,,, does not change????

Yes, mine is normal. I'm using a 2.6.26.

Yes, mine is normal. I'm using a 2.6.26.

Mine is 3.1.

Yes, mine is normal. I'm using a 2.6.26.

Boss, you write an example to me to see Bai,,,, e-mail!!! 81295663@qq.com
Appreciate!!!!!! Very anxious!!!

I just tested it with your code, TPL takes value: {$Time}

I just tested it with your code, TPL takes value: {$Time}

Do you add after execution,, and then always is a value?? Doesn't change?

I just tested it with your code, TPL takes the value: {$Time} does not change over time??

I just tested it with your code, TPL takes value: {$Time}

Boss, add me qq, say OK?? Thanks a little brother!! 81295663

Yes, it won't change. You try it with the lower version of Smarty.

Yes, it won't change. You try it with the lower version of Smarty.

Great God,,, sure enough,,,,, my 3.1 has a problem!!!!!

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.