• astaxie's avatar
    fix #153 · 9d84969b
    astaxie authored
    已经支持了任意定义变量的路由形式,具体的使用请参考:
    
    func TestManyRoute(t *testing.T) {
    
    	r, _ := http.NewRequest("GET", "/beego32-12.html", nil)
    	w := httptest.NewRecorder()
    
    	handler := NewControllerRegistor()
    	handler.Add("/beego:id([0-9]+)-:page([0-9]+).html", &TestController{})
    	handler.ServeHTTP(w, r)
    
    	id := r.URL.Query().Get(":id")
    	page := r.URL.Query().Get(":page")
    
    	if id != "32" {
    		t.Errorf("url param set to [%s]; want [%s]", id, "32")
    	}
    	if page != "12" {
    		t.Errorf("url param set to [%s]; want [%s]", page, "12")
    	}
    }
    9d84969b
Name
Last commit
Last update
cache Loading commit data...
config Loading commit data...
context Loading commit data...
example Loading commit data...
httplib Loading commit data...
logs Loading commit data...
middleware Loading commit data...
orm Loading commit data...
session Loading commit data...
testing Loading commit data...
validation Loading commit data...
.gitignore Loading commit data...
README.md Loading commit data...
app.go Loading commit data...
beego.go Loading commit data...
config.go Loading commit data...
controller.go Loading commit data...
filter.go Loading commit data...
flash.go Loading commit data...
log.go Loading commit data...
reload.go Loading commit data...
router.go Loading commit data...
router_test.go Loading commit data...
safemap.go Loading commit data...
safemap_test.go Loading commit data...
template.go Loading commit data...
template_test.go Loading commit data...
utils.go Loading commit data...
utils_test.go Loading commit data...