Smarty的保留变量
2017-11-22 11:04
302 查看
一 代码
index.php
index.tpl
二 运行结果
变量type的值是:
当前路径为:/test/29/3/index.php
当前时间为:1492600251
index.php
<?php include '../config.php'; $smarty->assign('title','Smarty保留变量'); $smarty->display('3/index.tpl'); ?>
index.tpl
<!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=gb2312" /> <title>{ $title }</title> <link rel="stylesheet" href="../css/style.css" /> </head> <body> {* 使用get变量获取url中的变量值(ex: http://localhost/tm/sl/28/3/index.php?type=computer)*} 变量type的值是:{ $smarty.get.type }<br /> 当前路径为:{ $smarty.server.PHP_SELF}<br /> 当前时间为:{$smarty.now} </body> </html>
二 运行结果
变量type的值是:
当前路径为:/test/29/3/index.php
当前时间为:1492600251
相关文章推荐
- smarty模板中的保留变量
- 【smarty】smarty保留变量的使用
- PHP模板引擎Smarty中的保留变量用法分析
- smarty的保留变量
- smarty的保留变量问题
- smarty保留变量
- PHP Smarty 保留变量
- smarty手记4--使用保留变量
- smarty变量以及保留变量
- php smarty的预保留变量总结
- Smarty保留变量
- Smarty中的请求变量和保留变量的使用范例
- smarty中保留变量总结
- Smarty保留变量用法分析
- PHP模板引擎Smarty中的保留变量用法分析
- Smarty保留变量
- smarty保留变量中的foreach与section
- Smarty 保留变量
- smarty保留变量与调用配置文件
- Smarty核心内容:保留变量