路由
beego.Router("/hellos",&controllers.HelloControllers{},"post:Oq")
方法
func (this * HelloControllers) Oq() {
user:=this.GetString("name")
pwd:= this.GetString("password")
this.Ctx.WriteString("user="+user+" pwd="+pwd)
}
方法 //解析login模板
func (this * HelloControllers) Get(){
this.TplName ="index.tpl"
}
模板
<body>
<form action="/hellos" method="post">
<input name="name" type="text"><br>
<input name="password" type="text"><br>
<input type="submit" value="提交">
</form>
</body>
go 笔记
最新推荐文章于 2022-05-12 15:21:45 发布