HopenGolang web 极速开发框架
Golang web 极速开发框架。
使用:
main
func init(){ //hopen.AddRouter("/test/:id([0-9]+)/sss",&testController.TestController{},"get:tohtml"); //hopen.AddAutoRouter("/test/:id([0-9]+)/tohtml",&testController.TestController{}); hopen.AddPrefixAutoRouter("/test",&testController.TestController{}); } func main(){ hopen.Run() }
controller
type TestController struct { hopen.Controller } func (t *TestController) Sayhello() { print(t.R.Form.Get("id")) } func (t *TestController) ToJson() { m := make(map[string]string) m["show_branch"] = "false" m["t0"] = "true" m["t1"] = "true" t.SetValue("data", m) t.SetValue("msg", "测试") t.SetValue("status", "测试") t.RenderJson() } type Servers struct { XMLName xml.Name `xml:"server"` ServerName string `xml:"serverName"` ServerIP string `xml:"serverIP"` } func (t *TestController) ToXml() { v := &Servers{ServerName:"2",ServerIP:"3"} t.RenderXml(v) } func (t *TestController) ToHtml() { id ,_ := t.GetI("id",-1); t.SetValue("msg", "id is " + strconv.FormatInt(int64(id), 10)) t.Render("tmpl/welcome.html") } func (t *TestController) RedirectTo() { t.Redirect("tojson") }
评论
weiit-frame极速 web 开发框架
Weiit是基于Java语言的极速web开发框架,其核心设计目标是开发迅速、代码量少、学习简单、功能强大、轻量级、易扩展、Restful。Weiit适用于快速开发,轻应用型的应用开发,大大降低开发人员
weiit-frame极速 web 开发框架
0
Jweb-bootJava 极速开发框架
Jweb-boot是基于JFinal+Jboot +undertow进行开发增强而来的极速开发基础框架,无它!愿景瑞士军刀成为web开发的一把瑞士军刀。统一框架自由组合,以适应不同的系统结构。让不管是
Jweb-bootJava 极速开发框架
0