ExecuteViewPathTemplate 执行指定的模板并返回执行结果.
(tplName string, data interface{})
| 250 | |
| 251 | // ExecuteViewPathTemplate 执行指定的模板并返回执行结果. |
| 252 | func (this *BaseController) ExecuteViewPathTemplate(tplName string, data interface{}) (string, error) { |
| 253 | var buf bytes.Buffer |
| 254 | |
| 255 | viewPath := this.ViewPath |
| 256 | |
| 257 | if this.ViewPath == "" { |
| 258 | viewPath = beego.BConfig.WebConfig.ViewsPath |
| 259 | |
| 260 | } |
| 261 | |
| 262 | if err := beego.ExecuteViewPathTemplate(&buf, tplName, viewPath, data); err != nil { |
| 263 | return "", err |
| 264 | } |
| 265 | return buf.String(), nil |
| 266 | } |
| 267 | |
| 268 | func (this *BaseController) BaseUrl() string { |
| 269 | host := beego.AppConfig.String("sitemap_host") |
no outgoing calls
no test coverage detected