Эх сурвалжийг харах

Merge branch 'master' of http://192.168.3.207:10080/BP/common into master

zhangxinlei1996 4 жил өмнө
parent
commit
4f458faa78

+ 1 - 1
src/github.com/go-xweb/xweb/action.go

@@ -709,7 +709,7 @@ func (c *Action) Render(tmpl string, params ...*T) error {
 }
 
 //仅生成网页内容
-var regInclude = regexp.MustCompile(`\{\{\s*include\s*"(.*?\.html)"\}\}`)
+var regInclude = regexp.MustCompile(`\{\{\s*include\s*"(.*?\.html)".*\}\}`)
 
 func (c *Action) NamedRender4Cache(name, content string, params ...*T) ([]byte, error) {
 	c.f["oinclude"] = c.Include

+ 3 - 0
src/github.com/go-xweb/xweb/template.go

@@ -365,6 +365,9 @@ func newIncludeIntmpl(rootDir string, content []byte) []byte {
 			b = true
 			tpl := regInclude.FindSubmatch(m)[1]
 			fpath := filepath.Join(rootDir, string(tpl))
+			if strings.Contains(string(m), "OUTSIDE") {
+				fpath = string(tpl)
+			}
 			c, err := ioutil.ReadFile(fpath)
 			if err != nil {
 				return []byte{}