微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

smarty中post用法实例

本文实例讲述了smarty中post用法分享给大家供大家参考。具体分析如下:

知道了smarty的运行原理之后,就想写个post的实现过程,以下是实现post的代码,跟独自写PHP代码差不多,只是多了显示文件

配置文件:conf.PHP

代码如下:
template_dir ='templates/'; $my->compile_dir ='templates_c/'; $my->config_dir ='configs/'; $my->cache_dir ='cache/'; ?>
index.PHP
代码如下:
assign('content','welcome to arrival'); $my->assign('mylife',array("生活","吃饭","梦想","凉风","报仇","fuck someone","fuck you die")); $my->display('kk.html'); ?>
template下的kk.html【index.PHP显示文件
代码如下:
无<a href="https://www.jb51.cc/tag/biaoti/" target="_blank" class="keywords">标题</a>文档 {$content} {section name=truelife loop=$mylife} {$mylife[truelife]} {/section}

{html_select_time use_24_hours=true}

PHP">