<?php
define('ROOT_PATH', dirname(__FILE__)); //网站根目录
require ROOT_PATH.'/libs/Smarty.class.php'; //引入 Smart 模板引擎
$_tpl = new Smarty(); //初始化一个对象
$_tpl->template_dir = ROOT_PATH.'/tpl/'; //重新设置网站的模板目录
$_tpl->compile_dir = ROOT_PATH.'./com/'; //重新设置网站的编译文件目录
$_tpl->config_dir = ROOT_PATH.'/configs/'; //重新设置网站的配置文件目录
$_tpl->left_delimiter = '<{'; //重新设置网站的左定界符
$_tpl->right_delimiter = '}>'; //重新设置网站的右定界符
?>
<?php
require 'init.inc.php'; //引入模板初始化文件
global $_tpl;
$_tpl->display('index.tpl'); //载入模板文件
?>
<{config_load file="view.conf" section="one"}>
<!-- view.conf文件不能写完整路径,因为在初始化文件中已经指定,section="one" 代表加载[one]区域 -->
<!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>
<table border="<{#border#}>" align="<{#align#}>" width="<{#tabw#}>">
<tr bgcolor="<{#bgcolor#}>" align="<{#align#}>">
<td>aaaa</td>
<td>aaaa</td>
<td>aaaa</td>
<td>aaaa</td>
<tr>
<tr>
<td>aaaa</td>
<td>aaaa</td>
<td>aaaa</td>
<td>aaaa</td>
<tr>
<tr>
<td>aaaa</td>
<td>aaaa</td>
<td>aaaa</td>
<td>aaaa</td>
<tr>
<tr>
<td colspan="<{#colspan#}>" align="<{#align#}>">
区域变量的显示:
<{#aa#}><br />
<{#bb#}><br />
<{#cc#}><br />
</td>
</tr>
</table>
</body>
</html>
border=2 tabw=600 tabh=500 bgcolor=yellow align=center [one] colspan=4 aa=one section [two] bb=two section [three] cc=three section
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有