Smarty读取配置文件

阅读更多

一 代码

config文件
title = "调用配置文件"
bgcolor = "#f0f0f0"
border = "5"
type = "计算机类"
name = "PHP从入门到精通"
tpl模板文件
{config_load file="4.conf"}




{#title#}



{$smarty.config.type} {$smarty.config.name}
 
 
php文件
display('4/index.tpl');
?>
 
二 运行结果
Smarty读取配置文件_第1张图片
 
  • Smarty读取配置文件_第2张图片
  • 大小: 9.5 KB
  • 查看图片附件

你可能感兴趣的:(Smarty,配置文件)