提交 0e748c68 编写于 作者: A astaxie

parse url to params

/object/login/2009/07/11
parse to ObjectController  Login function
params:map[0:2009 1:07 2:11]
上级 f7e7fab6
......@@ -548,9 +548,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
if strings.HasPrefix(strings.ToLower(requestPath), "/"+cName+"/"+strings.ToLower(mName)) {
//parse params
otherurl := requestPath[len("/"+cName+"/"+strings.ToLower(mName)):]
if len(otherurl) > 1 && otherurl[0] != '/' {
if len(otherurl) > 1 {
plist := strings.Split(otherurl, "/")
for k, v := range plist {
for k, v := range plist[1:] {
params[strconv.Itoa(k)] = v
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册