smarty
benben0729
职业为猿的汪,爱好象、鼠、蛇、蛙
展开
-
smarty模板引擎
Smarty下载解压smarty文件夹下的文件。将Smarty的核心代码拷贝到站点下。Smarty.class.phpTemplates:默认模板文件夹Templates_c:默认存放文件的文件夹Cache:存放缓存Configs:存放配置文件定义目录分隔符: 注释{*这是注释*}Smarty注释和HTML注...原创 2018-07-24 14:21:57 · 375 阅读 · 0 评论 -
display与fetch的区别
<?phpinclude_once 'smarty.php';$smarty->assign('title','标题');$smarty->assign('content','内容');$output = $smarty->fetch('index.html');echo $output;// $smarty->display('index.html...原创 2018-10-10 17:44:13 · 1243 阅读 · 0 评论 -
Smarty 常用操作
路径设置templates/templates_c/cache/configs/libs/注意:templates_c和cache两个目录的权限要设置成777(chmod -R 777 templates_c cache)首次使用#在templates目录下增加一个demo.tpl的文件,里面写上hello worldindex.php文件如下:<?phpr...原创 2018-10-10 17:45:40 · 210 阅读 · 0 评论 -
Smarty 20个常用变量操作符
参数规则:“:”冒号隔开,“...”省略号占位capitalize [首字母大写] count_characters [计算字符数] cat [连接字符串] count_paragraphs [计算段落数]count_sentences [计算句数]count_words [计算词数]date_format [时间格式]default [默认]escape [转码]in...原创 2018-10-10 17:46:55 · 276 阅读 · 0 评论