保留变量测试
来源:互联网 发布:2016手机淘宝开店教程 编辑:程序博客网 时间:2024/05/15 00:49
<?php
include('libs/Smarty.class.php');
$a=new Smarty();
setcookie('name','dany');
$arr=array(1,2,3,4,5,6,7,8,9);
$a->template_dir="demo/templates";
$a->compile_dir="demo/templates_c";
$a->left_delimiter="<{";
$a->right_delimiter="}>";
$a->assign('array',$arr);
$a->display("cs.tpl");
——————————————————————————————————————————————上为php文件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<body>
<form action='cs.php' method="post">
<input type='text' name='page'>
<input type='submit' value='提交'>
</form>
</body>
</html>
——————————————————————————————————————————————————上为html文件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<{$smarty.cookies.name}>
<{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}>
<{foreach from=$array item=row name=a1}>
<{$row}>
<{/foreach}>
输出<{$smarty.foreach.a1.total}>次<br>
<{section name=b loop=$array}>
<{$array[b]}>
<{/section}>
输出<{$smarty.section.b.total}>次<br>
<{$smarty.get.page}>
<{$smarty.post.page}>
</body>
</html>
———————————————————————————————————————————————————上为tpl文件
- 保留变量测试
- smarty变量以及保留变量
- smarty的保留变量
- smarty的保留变量
- smarty保留变量
- Smarty保留变量
- Smarty保留变量
- $smarty的保留变量
- smarty保留变量
- Smarty核心内容:保留变量
- Smarty的保留变量
- smarty模板中的保留变量
- smarty中保留变量总结
- 把Decimal变量保留指定的小数位
- 工作空间保留指定变量 clearvars matlab
- smarty保留变量与调用配置文件
- smarty保留变量中的foreach与section
- 【smarty】smarty保留变量的使用
- hdu 1074 Doing Homework
- 购物网站
- MySQL
- 在XP上同时运行IE6,IE7,IE8,IE9
- [10月30日的脚本] 在微软Exchange 2010中获取邮箱使用报表
- 保留变量测试
- smarty模板技术
- ec_shop项目(复习篇)
- 验证码画布设计
- Json
- 输出一定范围内的奇偶数(foreach/section/if_elseif_else)
- smarty的配置文件以及配置文件的加载
- Smarty中变量调节器
- network: android 使用广播监听网络状态