1
使用$ smarty-> fetch時,它將模板拉入變量。有沒有辦法對該變量進行預解析的字符串操作?smarty取取字符串替換
例子:
PHP:
$variable = $smarty->fetch('template.tpl');
$variable = str_replace("{include file='../another_dir", "{include file='", $variable);
template.tpl
{include file='incl.tpl'}
理想的結果將是有模板變成:
{include file='../another_dir/incl.tpl'}