Commit 118e0715 authored by liulixiang1988's avatar liulixiang1988

improve the 'geturl'

If we have a url mapping like this:
`beego.Router(“/test”, &controllers.WeightController{},
"get:GetDetails”)`
when u use `UrlFor(“WeightController.GetDetails”, “foo”, 1, “bar”, 2 `,
it should return `/test?foo=1&bar=2` rather than `/test`.
parent 2773fda8
......@@ -459,7 +459,7 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin
if find {
if l.regexps == nil {
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 v, ok := params[l.wildcards[0]]; ok {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment