{"action":"created","issue":{"url":"https://api.github.com/repos/astaxie/beego/issues/1136","labels_url":"https://api.github.com/repos/astaxie/beego/issues/1136/labels{/name}","comments_url":"https://api.github.com/repos/astaxie/beego/issues/1136/comments","events_url":"https://api.github.com/repos/astaxie/beego/issues/1136/events","html_url":"https://github.com/astaxie/beego/issues/1136","id":72115739,"number":1136,"title":"命名空间 和 模板加载路径","user":{"login":"SweetDevil","id":6388324,"avatar_url":"https://avatars.githubusercontent.com/u/6388324?v=3","gravatar_id":"","url":"https://api.github.com/users/SweetDevil","html_url":"https://github.com/SweetDevil","followers_url":"https://api.github.com/users/SweetDevil/followers","following_url":"https://api.github.com/users/SweetDevil/following{/other_user}","gists_url":"https://api.github.com/users/SweetDevil/gists{/gist_id}","starred_url":"https://api.github.com/users/SweetDevil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SweetDevil/subscriptions","organizations_url":"https://api.github.com/users/SweetDevil/orgs","repos_url":"https://api.github.com/users/SweetDevil/repos","events_url":"https://api.github.com/users/SweetDevil/events{/privacy}","received_events_url":"https://api.github.com/users/SweetDevil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-30T09:56:43Z","updated_at":"2015-12-30T08:36:04Z","closed_at":null,"body":"\r\n```go\r\nadminModule := beego.NewNamespace(`/admin`,\r\n\t\tbeego.NSRouter(\"/index/index\", &adminControllers.IndexController{},\"*:Index\"),\r\n\t)\r\nbeego.AddNamespace(adminModule)\r\n```\r\n我定义了这样一个路由 都在admin下面   \r\n\r\n这是控制器的RenderBytes默认模板路径\r\n```go\r\nc.TplNames = strings.ToLower(c.controllerName) + \"/\" + strings.ToLower(c.actionName) + \".\" + c.TplExt\r\n```\r\n有没有什么办法可以获取到我当前这个请求运行在哪个namespace下面也就是/admin这一段\r\n\r\n然后我的模板加载路径就是\r\n```go\r\nTplNames = 命名空间路径+c.TplNames = strings.ToLower(c.controllerName) + \"/\" + strings.ToLower(c.actionName) + \".\" + c.TplExt\r\n````\r\n有没有可能增加一个模板加载路径的接口  让开发者自定义模板加载路径\r\n\r\n在每个控制器里面写 TplNames太麻烦了"},"comment":{"url":"https://api.github.com/repos/astaxie/beego/issues/comments/167957701","html_url":"https://github.com/astaxie/beego/issues/1136#issuecomment-167957701","issue_url":"https://api.github.com/repos/astaxie/beego/issues/1136","id":167957701,"user":{"login":"lei-cao","id":136104,"avatar_url":"https://avatars.githubusercontent.com/u/136104?v=3","gravatar_id":"","url":"https://api.github.com/users/lei-cao","html_url":"https://github.com/lei-cao","followers_url":"https://api.github.com/users/lei-cao/followers","following_url":"https://api.github.com/users/lei-cao/following{/other_user}","gists_url":"https://api.github.com/users/lei-cao/gists{/gist_id}","starred_url":"https://api.github.com/users/lei-cao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lei-cao/subscriptions","organizations_url":"https://api.github.com/users/lei-cao/orgs","repos_url":"https://api.github.com/users/lei-cao/repos","events_url":"https://api.github.com/users/lei-cao/events{/privacy}","received_events_url":"https://api.github.com/users/lei-cao/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T08:36:04Z","updated_at":"2015-12-30T08:36:04Z","body":"@SweetDevil Thank you for supporting beego. please update or submit your issue in English for a better international user friendly communication."}}