使用Smarty六步走
① 设置响应头信息(防止出现乱码)
header(‘Content-type:text/html; charset=utf-8’);

② 载入Smarty入口文件(载入Smarty类)
include ‘smarty/Smarty.class.php’);

③ 实例化Smarty类
$smarty = new Smarty();

④ 更改Smarty对象的默认属性(左右分隔符…)
$smarty->属性 = 属性值;

⑤ 分配变量到模板文件(assign方法)
$smarty->assign(‘标记名称’,’替换后的值’);

⑥ 显示输出模板的内容
$smarty->display(‘模板文件的名称’);
PHP操作Smarty

相关文章:

  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2021-11-27
猜你喜欢
  • 2021-09-02
  • 2021-08-02
  • 2021-10-31
  • 2022-02-13
  • 2022-12-23
相关资源
相似解决方案