smarty 如果给模板传值是动态的,生成缓存 也是动态啊

WBOY
Release: 2016-06-23 14:12:09
Original
896 people have browsed it

smarty   如果给模板传值是动态的,生成缓存 也是动态啊,,为什么???


例如:$smarty->caching = true;
$smarty->cache_lifetime = 50100;
$showtime=date("YmdHms")
//设置缓存文件名
$smarty->assign("Name","Fred");
$smarty->assign("Time",$showtime);



模板文件接收$showtime    页面刷新后这个值 一直变啊,,,,不是缓存吗??
为什么会变??????


回复讨论(解决方案)

我用你的代码发现是正常的,你的smarty 是什么版本?

我用你的代码发现是正常的,你的smarty 是什么版本?  在吗,最新版本,,留下QQ,,我的QQ:81295663。。。  重谢

我用你的代码发现是正常的,你的smarty 是什么版本?  我下载的最新版本!!!!!

我用你的代码发现是正常的,你的smarty 是什么版本?

你的正常是什么,,,不变化吗????

是的,我的是正常的。我用的是 2.6.26 

是的,我的是正常的。我用的是 2.6.26 

我的是3.1

是的,我的是正常的。我用的是 2.6.26 

老大,吧你写的例子给我看看呗,,,,发邮箱!!!81295663@qq.com 
感激不尽!!!!!!着急很!!!

我就是用你的代码测试的啊,tpl 取值:{$Time}

我就是用你的代码测试的啊,tpl 取值:{$Time}

你加上之后后执行,,,然后 一直是一个值吗??不会变化?

我就是用你的代码测试的啊,tpl 取值:{$Time}  不会随时间变化变化??

我就是用你的代码测试的啊,tpl 取值:{$Time}

老大,加我QQ,说下好吗??小弟万分感谢!! 81295663

是的,不会变化。你用低版本的smarty试试看。

是的,不会变化。你用低版本的smarty试试看。

大神,,,果然是,,,,,我的3.1 有问题!!!!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!