{"action":"closed","issue":{"url":"https://api.github.com/repos/astaxie/beego/issues/1697","repository_url":"https://api.github.com/repos/astaxie/beego","labels_url":"https://api.github.com/repos/astaxie/beego/issues/1697/labels{/name}","comments_url":"https://api.github.com/repos/astaxie/beego/issues/1697/comments","events_url":"https://api.github.com/repos/astaxie/beego/issues/1697/events","html_url":"https://github.com/astaxie/beego/issues/1697","id":134582730,"number":1697,"title":"跨模版文件读取$变量？","user":{"login":"xdxiaodong","id":7643447,"avatar_url":"https://avatars.githubusercontent.com/u/7643447?v=3","gravatar_id":"","url":"https://api.github.com/users/xdxiaodong","html_url":"https://github.com/xdxiaodong","followers_url":"https://api.github.com/users/xdxiaodong/followers","following_url":"https://api.github.com/users/xdxiaodong/following{/other_user}","gists_url":"https://api.github.com/users/xdxiaodong/gists{/gist_id}","starred_url":"https://api.github.com/users/xdxiaodong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xdxiaodong/subscriptions","organizations_url":"https://api.github.com/users/xdxiaodong/orgs","repos_url":"https://api.github.com/users/xdxiaodong/repos","events_url":"https://api.github.com/users/xdxiaodong/events{/privacy}","received_events_url":"https://api.github.com/users/xdxiaodong/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-18T13:37:32Z","updated_at":"2016-03-08T11:33:07Z","closed_at":"2016-03-08T11:33:07Z","body":"假设：  \r\n模版文件A文件名为index.tpl  \r\n模版文件B文件名为foot.tpl  \r\n我在模版A内定义变量{{$x := \"beego\"}}  {{template \"foot.tpl\" .}}\r\n然后在模版B内输出模版A内定义的变量{{print $x}}，编译的时候就会提示模版文件编译错误，找不到变量$x  \r\n如果我是在模版A内输出{{print $x}}就不会报错，可以正常输出  \r\n**是不支持这样使用，还是我用法不对呢？这个问题困扰我好几天了**"}}