X Tutup
Skip to content

Commit 8fdce19

Browse files
committed
Merge pull request top-think#55 from dodgepudding/master
修正普通分组模式下模块跨分组调用, 模板include跨分组路径错误bug
2 parents 49917d6 + 7e006dd commit 8fdce19

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

ThinkPHP/Lib/Behavior/LocationTemplateBehavior.class.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ private function parseTemplateFile($templateFile) {
4040
if(strpos($templateFile,'@')){
4141
list($group,$templateFile) = explode('@',$templateFile);
4242
if(1==C('APP_GROUP_MODE')){
43-
$basePath = dirname(BASE_LIB_PATH).'/';
43+
$basePath = dirname(BASE_LIB_PATH).'/'.$group.'/'.basename(TMPL_PATH).'/'.(THEME_NAME?THEME_NAME.'/':'');
4444
}else{
45-
$basePath = TMPL_PATH;
45+
$basePath = TMPL_PATH.'/'.$group.'/'.(THEME_NAME?THEME_NAME.'/':'');
4646
}
47-
$basePath .= $group.'/'.basename(TMPL_PATH).'/'.(THEME_NAME?THEME_NAME.'/':'');
4847
}else{
4948
$basePath = THEME_PATH;
5049
}

ThinkPHP/Lib/Template/ThinkTemplate.class.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -675,11 +675,10 @@ private function parseTemplateName($templateName){
675675
if(strpos($templateName,'@')){
676676
list($group,$templateName) = explode('@',$templateName);
677677
if(1==C('APP_GROUP_MODE')){
678-
$basePath = dirname(BASE_LIB_PATH).'/';
679-
}else{
680-
$basePath = TMPL_PATH;
681-
}
682-
$basePath .= $group.'/'.basename(TMPL_PATH).'/'.(THEME_NAME?THEME_NAME.'/':'');
678+
$basePath = dirname(BASE_LIB_PATH).'/'.$group.'/'.basename(TMPL_PATH).'/'.(THEME_NAME?THEME_NAME.'/':'');
679+
}else{
680+
$basePath = TMPL_PATH.'/'.$group.'/'.(THEME_NAME?THEME_NAME.'/':'');
681+
}
683682
}else{
684683
$basePath = THEME_PATH;
685684
}

0 commit comments

Comments
 (0)
X Tutup