在ecshop模板中,
{include file="header.tpl"}
这个是正确的,能加载header.tpl到页面中可是如果是变量,就失败了
{include file=$filename}
会提示:Parse error: syntax error, unexpected T_STRING in C:\wamp\www\ecshop\upload\includes\cls_template.php(1161) : eval()'d code on line 1
当然,我有在php页中加入:
$filename="header.tpl";
$smarty->assign('filename',$filename); 下面是我的问题:
1.在smarty模板中这样写({include file=$filename})是正确的,为什么在ecshop就是错误的?
2.ecshop的smarty与smarty模板区别多大?
3.那在ecshop中应该怎么写(最重要的问题)?

解决方案 »

  1.   

    {include file=$filename}这个好像只能引入js文件吧
      

  2.   

    {include file="header.tpl"}
    {include file="header.html"}
    都是成功的请玩过ecshop的高手解答
      

  3.   

    无人能解答这个问题吗?个人认为ecshop应该是不支持引入变量的方法!
    只是不知道ecshop团队不知道为什么要禁用这个方法!
    难道是为了让大家不要去改变ecshop程序!
    只能在模板那边下功夫吗?