我的smarty已经连接好了 ,但是我这个写好之后,我在index.htm中写了“原始内容:{$name};”那么在index.php中应该显示“原始内容:it is a hard work,and you must keep on。”才对的,但是我的显示是“原始内容:$name.”
<?php
/*
 * Created on 2010-10-18
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 include("smarty_inc.php");
   $value="it is a hard work,and you must keep on.";
       $smarty->assign("name",$value);
   $smarty->display("index.htm");?>
请高手帮我看是怎么会事的,好像这个assign就没有起作用。

解决方案 »

  1.   

    <?php
    include_once("smarty/smarty.class.php");
    $smarty=new smarty();
    $smarty->config_dir="smarty/config_file.class.php";
    $smarty->caching=false;
    $smarty->template_dir="./templates";
    $smarty->compile_dir="./templates_c";
    $smarty->cache_dir="./smarty_cache";
    $smarty->left_delimiter="{";
    $smarty->right_delimiter="}";?>
      

  2.   

    代码里的是全角符号,改为 原始内容:{$name} 就ok了
      

  3.   

    按理说你输出的内容应该是 原始内容:{$name};  才对