From b209bf597861bb44f679b600869a2077d68e29b6 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 21 Dec 2015 07:43:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3layout=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/template.php b/library/think/template.php index 0085fe87..1aa3cce8 100644 --- a/library/think/template.php +++ b/library/think/template.php @@ -339,7 +339,7 @@ class Template //解析Layout标签 $array = $this->parseXmlAttrs($matches[1]); // 读取布局模板 - $layoutFile = $this->config['tpl_path'] . $array['name'] . $this->config['tpl_suffix']; + $layoutFile = (defined('THEME_PATH') && substr_count($array['name'], '/') < 2 ? THEME_PATH : $this->config['tpl_path']) . $array['name'] . $this->config['tpl_suffix']; $replace = isset($array['replace']) ? $array['replace'] : $this->config['layout_item']; // 替换布局的主体内容 $content = str_replace($replace, $content, file_get_contents($layoutFile));