2012-12-29 81 views
0

我使用的fetch()方法來存儲模板和內另一個顯示爲這樣:fetch()方法無法輸出 - Smarty的

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

其中mySmarty被實例化作爲Smarty類。我在mypage.html中調用{$ template}。

頁面「mypage.html」顯示正確,但{$ template}變量輸出爲0.它怎麼可能? (知道我正確設置權限)

回答

0

神祕,我設法通過這個技巧來過問題:$ template = $ this-> fetch('template.tpl'); $這個 - > mySmarty->分配( '模板',$模板);