1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-27 00:21:29 +00:00
Commit Graph

303 Commits

Author SHA1 Message Date
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
9f6b803a10 update middleware & beego's error 2013-09-11 17:00:39 +08:00
astaxie
e7f08946d1 improve the performance 2013-09-11 15:16:09 +08:00
astaxie
a88750d2b3 support websocket 2013-09-10 17:56:06 +08:00
astaxie
bd61dd9ffc change a log about new version 2013-09-10 00:00:18 +08:00
astaxie
50f3bd5835 add filter after 2013-08-12 00:14:42 +08:00
astaxie
1f3ae3d682 Improve performance 2013-08-11 23:27:53 +08:00
astaxie
bbef213155 fix #144 2013-08-10 21:44:27 +08:00
astaxie
f9a31ea00a EnableXSRF 2013-08-06 23:21:52 +08:00
astaxie
fd3c8834da autorouter when /admin 301 to /admin/ 2013-08-04 23:13:29 +08:00
astaxie
3d481178d7 improve router 2013-08-04 23:06:48 +08:00
astaxie
a997ca746f fix router's /path/ 2013-07-30 22:38:01 +08:00
astaxie
572e281566 fix router's bug 2013-07-30 22:33:36 +08:00
astaxie
8674b81b3a fix router & tpl tolower 2013-07-30 22:17:16 +08:00
astaxie
0e748c6871 parse url to params
/object/login/2009/07/11
parse to ObjectController  Login function
params:map[0:2009 1:07 2:11]
2013-07-27 10:55:10 +08:00
astaxie
f7e7fab6f2 support autorouter 2013-07-27 10:25:14 +08:00
astaxie
ab08aa9c9e MethodByName 2013-07-25 16:08:18 +08:00
astaxie
7c610ee7c9 fix reflect find methodByName 2013-07-25 16:00:42 +08:00
astaxie
e88c2be013 update docs & update beego's version 2013-07-25 15:37:38 +08:00
astaxie
d5ddd0a9dd support user define function
+//Add("/user",&UserController{})
+//Add("/api/list",&RestController{},"*:ListFood")
+//Add("/api/create",&RestController{},"post:CreateFood")
+//Add("/api/update",&RestController{},"put:UpdateFood")
+//Add("/api/delete",&RestController{},"delete:DeleteFood")
+//Add("/api",&RestController{},"get,post:ApiFunc")
+//Add("/simple",&SimpleController{},"get:GetFunc;post:PostFunc")
2013-07-25 15:17:09 +08:00
Unknown
7f5dd13422 Fixed bug: error page cannot show correct corresponding status code 2013-07-18 14:42:45 +08:00
astaxie
7bfb4126d7 support copy requestbody 2013-07-08 23:12:31 +08:00
astaxie
ee9223b1b9 fix #18
func (this *MainController) Get() {
this.GoToFunc("Test")
}

func (this *MainController) Test() {
this.Ctx.WriteString("testtest")
}
2013-07-08 17:35:09 +08:00
astaxie
11977f4f77 fix #90 2013-07-07 17:58:50 +08:00
astaxie
461eac46b9 fix #89 2013-07-07 17:45:39 +08:00
astaxie
75af664511 change r.ParseMultipartForm position 2013-07-04 23:41:35 +08:00
astaxie
9e41d93184 delete strcut map
I think if user should set field in controller, there's no need to have
thie feature
2013-06-25 16:44:53 +08:00
astaxie
512ddf8a70 fix small bug for not return 2013-06-24 23:56:53 +08:00
astaxie
c5a23d5cde fix #81 2013-06-24 23:24:33 +08:00
astaxie
3475685233 add Server info 2013-06-20 15:49:43 +08:00
Lunny Xiao
f20ad0916f bug fix 2013-06-04 19:45:48 +08:00
Lunny Xiao
65041aae71 remove nonuse parseForm and change the StructMap's params 2013-05-31 14:07:06 +08:00
Lunny Xiao
8b7cba037e add url params -> controller's member feature 2013-05-28 16:43:23 +08:00
Lunny Xiao
2dee30183d add structmap function for controller 2013-05-28 13:58:42 +08:00
astaxie
719f94b35f fix findrouter & template mix 2013-05-13 16:31:23 +08:00
astaxie
d6dd84d535 favicon.ico default deal with static files 2013-05-08 16:35:29 +08:00
astaxie
ce77c273cf add Destructor func 2013-05-08 13:56:48 +08:00
astaxie
a851641f48 update params 2013-05-08 13:00:35 +08:00
astaxie
1e7c1a265e fix #16 2013-05-07 00:17:25 +08:00
astaxie
7b6a571f87 fix build 2013-04-27 22:48:20 +08:00
astaxie
cf82cfeea2 #45 add support post+_method 2013-04-27 22:47:48 +08:00
astaxie
f4a645027e add error show page 2013-04-11 14:35:43 +08:00
astaxie
f00ac81008 word change to string 2013-04-10 10:20:23 +08:00
astaxie
465ed4b72f fix router's bug 2013-04-09 23:51:19 +08:00
astaxie
2f02653b7d add GetFIle & enhance router 2013-04-09 23:33:48 +08:00
astaxie
4353c98fd0 fix router's bug when requestpath only have one character 2013-04-08 21:26:38 +08:00
astaxie
3ad639e739 support websocket #20
add example chat
2013-04-08 00:28:32 +08:00
astaxie
4d4096c7e4 fix previer bug 2012-12-19 16:41:39 +08:00
astaxie
3f076f4ca0 fix router like /admin/index/ should equal to /admin/index 2012-12-19 16:38:25 +08:00
astaxie
5ce009a2dc fix bug 2012-12-19 11:26:10 +08:00
astaxie
8a99591298 fix bug 2012-12-18 15:18:48 +08:00
xiemengjun
f593c1f3fd init framwork 2012-12-15 23:53:19 +08:00