Smarty读取配置文件
来源:互联网 发布:北京南街村方便面 知乎 编辑:程序博客网 时间:2024/05/16 19:03
一 代码
config文件
title = "调用配置文件"bgcolor = "#f0f0f0"border = "5"type = "计算机类"name = "PHP从入门到精通"
tpl模板文件
{config_load file="4.conf"}<!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 bgcolor="{#bgcolor#}"><table border="{#border#}"><tr><td>{$smarty.config.type}</td><td>{$smarty.config.name}</td></tr></table></body></html>
php文件
<?phpinclude_once '../config.php';$smarty->display('4/index.tpl');?>
二 运行结果
阅读全文
0 0
- Smarty读取配置文件
- 从配置文件读取smarty变量
- 从配置文件读取smarty变量
- smarty 从配置文件读取变量 config_load
- smarty使用变量(从配置文件读取变量 +Smarty变量调节器)
- smarty配置文件
- smarty-配置文件
- smarty配置文件
- Smarty 配置文件
- smarty加载配置文件和读取其中的参数
- 编写smarty配置文件
- Smarty配置文件内置变量
- smarty的有关配置文件
- Smarty的配置文件
- Smarty中的配置文件
- 关于Smarty的配置文件
- $smarty的保留变量与从配置文件中读取的变量
- smarty 读取字符串模板
- Smarty的保留变量
- handler
- Smarty的变量调节器
- OpenCV实践之路——人脸识别之二模型训练
- 文章标题
- Smarty读取配置文件
- Smarty的条件判断
- Java中的properties配置文件
- numpy bincount 智障理解版
- 小白笔记----------------------------------------leetcode(39. Combination Sum )
- 简单工厂模式
- Smarty使用foreach语句循环输出数组
- Java基础——深入理解Java线程池
- /bin/sh: /tmp/xxx.sh: Permission denied