加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

smarty中post用法实例

发布时间:2020-12-12 20:31:54 所属栏目:PHP教程 来源:网络整理
导读:本篇章节讲解smarty中post用法。供大家参考研究。具体分析如下: 知道了smarty的运行原理之后,就想写个post的实现过程,以下是实现post的代码,跟独自写php代码差不多,只是多了显示文件 配置文件:conf.php 代码如下: template_dir ='templates/';

本篇章节讲解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的显示文件】
代码如下:
无标题文档 {$content} {section name=truelife loop=$mylife} {$mylife[truelife]} {/section}

{html_select_time use_24_hours=true}