Home >Backend Development >PHP Tutorial > Smarty模版,tpl显示有关问题

Smarty模版,tpl显示有关问题

WBOY
WBOYOriginal
2016-06-13 13:20:001122browse

Smarty模版,tpl显示问题
刚开始学习Smarty模版,其它的配置什么都能成功,但是在写第一个试验程序的无法正常显示
  index.php中的内容::
    /*载入配置文件*/ 可以确定config文件配置正确。。。。。
include '../config.php';
/*声明数组*/
$arr = array('computerbook','name'=>'PHP进阶阶段','unit_price'=>array('price'=>'¥65.00','unit'=>'本'));
/*将标题和数组传给模版*/
$smarty -> assign('title','使用Smarty读取数组');
$smarty -> assign('arr',$arr);
/*要显示的模版页*/
$smarty ->display('02/index.tpl');
  ?>
  index,tpl模版文件中:
 
 


  {% $title %}
 
 

 
  璐
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn