欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

Samrty技术的 初步了解

发布时间:2025/3/20 32 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Samrty技术的 初步了解 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
<span style="font-size:18px;">Smarty 技术的使用 <?php #smarty 测试#引入smarty  require_once "./smarty/Smarty.class.php";   #必须加载该类文件#生成一个smarty对象$smarty = new Smarty();#设置smarty$smarty->left_delimiter='{'; #左修饰符$smarty->right_delimiter='}'; #右修饰符$tpl=$smarty->template_dir ="./libs/view/template"; #模板文件$smarty->cache_dir ="./libs/view/cache";  #缓存文件$smarty->compile_dir ="./libs/view/template_c";  #编译文件$smarty->caching = true;  #开启缓存$smarty->cache_lifetime = 100; #缓存生命周期#使用模板方法$smarty->assign('test','this is testSmarty!');   #进行赋值$smarty->display("index.tpl"); #输出 (必须在指定的目录下存在该文件,文件中用{$test} 表示以上赋值的&lsquo;test’)</span>
  • 本文来自:Linux教程网


转载于:https://blog.51cto.com/9820344/1624067

总结

以上是生活随笔为你收集整理的Samrty技术的 初步了解的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。