不知道从哪个版本开始取消了 allow_php_tag 该属性
我想在 Smarty模板里面使用 php代码该怎么办?

解决方案 »

  1.   

    还有我在模板  文件 index.html里面  再用 
    {include file='a.html'}    这里面有个 $test
    {include file='a.html'}    这里面有个 $test
    这样掉用了2次
    但是 第一次和 第二次 我需要执行的数据不一样 我该怎么办
    我想在第一次里输出       'XXX1' 数据
    第二次输出               'xxx2'数据 我该怎么办
      

  2.   

    传参:{include file='a.html?test1=ok'} 
    {include file='a.html?test2=ok'}#a.html$test1 = "a1";
    $test2 = "b2";
    if(isset($_GET['test1'])){
      $smarty->assign("test",$test1);
    }
    if(isset($_GET['test2'])){
      $smarty->assign("test",$test2);
    }
    至于allow_php_tag不清楚了
      

  3.   

    {include file='a.html' test="aaa"}
    {include file='a.html' test="bbb"}