1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 08:40:54 +00:00
Commit Graph

9 Commits

Author SHA1 Message Date
astaxie
d57557dc55 add AutoRouterWithPrefix 2014-01-01 17:57:57 +08:00
astaxie
9edf3143e1 fix autorouter params 2013-12-18 10:00:52 +08:00
astaxie
ff1b8588e0 #313 2013-11-26 17:09:23 +08:00
astaxie
b16ef12ac0 fix test 2013-11-26 14:13:23 +08:00
astaxie
43057a2fcb fix #284 2013-11-10 23:26:28 +08:00
astaxie
9446563e5b add util func to get the url fix #282
UrlFor(endpoint string, values ...string) string
2013-11-10 23:05:07 +08:00
astaxie
4ce584c5a6 fix #201 2013-09-22 11:12:37 +08:00
astaxie
9d84969bf6 fix #153
已经支持了任意定义变量的路由形式,具体的使用请参考:

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")
	}
}
2013-09-13 11:22:14 +08:00
astaxie
1ff0a31d3f add router test 2013-09-11 15:49:12 +08:00