1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-04 16:40:20 +00:00

move the template related fun to template.go

This commit is contained in:
astaxie
2015-09-07 19:21:55 +08:00
parent 85d8ec5ca6
commit 284dfc0843
2 changed files with 29 additions and 29 deletions

View File

@ -100,30 +100,3 @@ func initBeforeHttpRun() {
}
}
}
// SetViewsPath sets view directory path in beego application.
func SetViewsPath(path string) *App {
ViewsPath = path
return BeeApp
}
// SetStaticPath sets static directory path and proper url pattern in beego application.
// if beego.SetStaticPath("static","public"), visit /static/* to load static file in folder "public".
func SetStaticPath(url string, path string) *App {
if !strings.HasPrefix(url, "/") {
url = "/" + url
}
url = strings.TrimRight(url, "/")
StaticDir[url] = path
return BeeApp
}
// DelStaticPath removes the static folder setting in this url pattern in beego application.
func DelStaticPath(url string) *App {
if !strings.HasPrefix(url, "/") {
url = "/" + url
}
url = strings.TrimRight(url, "/")
delete(StaticDir, url)
return BeeApp
}