2014-01-16 64 views
0

下面的代碼:取代Smarty fetch()?

include 'Smarty.class.php'; 
$smarty = new Smarty; 
$smarty->assign('variable', $variable); 
$content = $smarty->fetch('content.tpl'); 

我如何刪除的Smarty和使用基本PHP函數?

我可以使用*的file_get_contents *,將這種送$變量文件:

$content = file_get_contents('content.php'); // I've renamed .tpl to .php 

回答