當前位置:
首頁 >
Samrty技术的 初步了解
發布時間:2025/3/20
31
豆豆
生活随笔
收集整理的這篇文章主要介紹了
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}?表示以上賦值的‘test’)</span>
本文來自:Linux教程網
轉載于:https://blog.51cto.com/9820344/1624067
總結
以上是生活随笔為你收集整理的Samrty技术的 初步了解的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: sublime text3函数追踪:ct
- 下一篇: Hark的数据结构与算法练习之图书馆排序