1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 14:20:54 +00:00

add TemplateCache

This commit is contained in:
xiemengjun 2013-01-06 10:15:08 +08:00
parent 8e90ddd577
commit 45710c3a3b

View File

@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"github.com/astaxie/session" "github.com/astaxie/session"
_ "github.com/astaxie/session/providers/memory" _ "github.com/astaxie/session/providers/memory"
"html/template"
"net/http" "net/http"
"os" "os"
"path" "path"
@ -15,6 +16,7 @@ var (
AppName string AppName string
AppPath string AppPath string
StaticDir map[string]string StaticDir map[string]string
TemplateCache map[string]*template.Template
HttpAddr string HttpAddr string
HttpPort int HttpPort int
RecoverPanic bool RecoverPanic bool
@ -36,6 +38,7 @@ func init() {
BeeApp = NewApp() BeeApp = NewApp()
AppPath, _ = os.Getwd() AppPath, _ = os.Getwd()
StaticDir = make(map[string]string) StaticDir = make(map[string]string)
TemplateCache = make(map[string]*template.Template)
var err error var err error
AppConfig, err = LoadConfig(path.Join(AppPath, "conf", "app.conf")) AppConfig, err = LoadConfig(path.Join(AppPath, "conf", "app.conf"))
if err != nil { if err != nil {