mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 21:51:28 +00:00
fix #260
This commit is contained in:
parent
7131dec3af
commit
5f4fe6d868
13
template.go
13
template.go
@ -154,10 +154,23 @@ func getTplDeep(root, file string, t *template.Template) (*template.Template, []
|
|||||||
if !HasTemplateEXt(m[1]) {
|
if !HasTemplateEXt(m[1]) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if e, _ := FileExists(filepath.Join(root, m[1])); e {
|
||||||
t, _, err = getTplDeep(root, m[1], t)
|
t, _, err = getTplDeep(root, m[1], t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, [][]string{}, err
|
return nil, [][]string{}, err
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
relativefile := filepath.Join(filepath.Dir(file), m[1])
|
||||||
|
if e, _ := FileExists(relativefile); e {
|
||||||
|
t, _, err = getTplDeep(root, m[1], t)
|
||||||
|
if err != nil {
|
||||||
|
return nil, [][]string{}, err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
panic("can't find template file" + m[1])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return t, allsub, nil
|
return t, allsub, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user