今天在看smarty摸版,哦哦开始做这个函数config_load这个函数的作用该函数用于从配置文件中加载变量
OK代码在就下面这些
conf.php
<?php
include_once("libs/Smarty.class.php"); //包含smarty类文件
$smarty1 = new Smarty();
$smarty1->template_dir = "htmlmoban";
$smarty1->compile_dir = "templates_c";
$smarty1->left_delimiter = "<{";
$smarty1->right_delimiter = "}>";
$smarty1->assign("name", "config_load 函数使用");
$smarty1->display("gogal.html");
?>
gogal.html
<{config_load file="../inc.conf"}>
<{$name}>
<{#ipc#}>
inc.conf
ipc="小戴个人门户提供技术文章"
运行下来结果就是
config_load 函数使用小戴个人门户提供技术文章