为什么我的Smarty不接受html模板格式
$smarty->display('test.tpl'); OK!
         $smarty->display('test.html'); 出错,找不到!

解决方案 »

  1.   

    可能出现的2个地方:1你smarty没有配置好,test通过了吗,2,试一下.htm可以吗
      

  2.   

    如何在smarty模板中调用PHP的函数?
    ---------test1.php....
    function bBar($bArray)
    {   
      ...
       echo "<a class=link4 href=?menu=".$bArray[0].">".$bArray[0]." | </a>.....";
      ...
    }----------test1.html
    ...<?php bBar($bArray); ?>
    ---------test1.tpl
    { ?????如何调用? inster 函数如何用? }
      

  3.   

    自己注册一个
    like:1.php
    ===============
    function a($data)
    {
    return '<font color=red>'.$data['data'].'</font>';
    }
    $smarty->register_function("a","a");1.tpl
    ==============================
    {a data='hellow world'}
      

  4.   

    1使用函数注册
    2{php}function(){/php}直接在模板中使用php语句
      

  5.   

    谢谢提示,另一个问题是为什么模板文件
    只接受.tpl
    不接受.html
    ??