Fetch()方法无法输出 - Smarty

时间:2012-12-29 15:27:22

标签: smarty fetch

我使用fetch()方法存储模板并将其显示在另一个模板中:

    $this->mySmarty->assign('template',$this->fetch('template.tpl'));
    $this->display('mypage.html');

其中mySmarty被实例化为一个聪明的类。我在mypage.html中调用{$ template}。

页面“mypage.html”正确显示,但{$ template}变量输出0.它怎么样? (知道我正确设置了权限)

1 个答案:

答案 0 :(得分:0)

神秘,我设法通过这个技巧解决了这个问题:$ template = $ this-> fetch('template.tpl'); $这 - > mySmarty->分配( '模板',$模板);

相关问题