1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-23 00:11:00 +00:00

Merge pull request #733 from liulixiang1988/develop

improve the 'geturl'
This commit is contained in:
astaxie 2014-08-11 22:25:53 +08:00
commit b5a2347e1d

View File

@ -459,7 +459,7 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin
if find { if find {
if l.regexps == nil { if l.regexps == nil {
if len(l.wildcards) == 0 { if len(l.wildcards) == 0 {
return true, strings.Replace(url, "/"+url_placeholder, "", 1) return true, strings.Replace(url, "/"+url_placeholder, "", 1) + tourl(params)
} }
if len(l.wildcards) == 1 { if len(l.wildcards) == 1 {
if v, ok := params[l.wildcards[0]]; ok { if v, ok := params[l.wildcards[0]]; ok {