优化View类对输出内容的替换

This commit is contained in:
thinkphp
2016-04-30 15:32:22 +08:00
parent a8a8d93baa
commit 23e085ecf1

View File

@@ -119,7 +119,7 @@ class View
APP_HOOK && Hook::listen('view_filter', $content);
// 允许用户自定义模板的字符串替换
if (!empty($this->replace)) {
$content = str_replace(array_keys($this->replace), array_values($this->replace), $content);
$content = strtr($content, $this->replace);
}
return $content;
}