代码如下:
include 'Smarty.class.php';
$smarty = new Smarty;
$smarty->assign('variable', $variable);
$content = $smarty->fetch('content.tpl');如何删除Smarty并使用基本的PHP函数?
我可以使用*file_get_contents*吗,这会把$variable发送到文件中吗:
$content = file_get_contents('content.php'); // I've renamed .tpl to .php发布于 2014-01-16 15:22:56
可以将fetch('string:'.$content);与Smarty 3或更高版本一起使用。
http://www.smarty.net/docs/en/resources.string.tpl
https://stackoverflow.com/questions/21155537
复制相似问题