<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          HopenGolang web 極速開發(fā)框架

          聯(lián)合創(chuàng)作 · 2023-09-20 07:35

          Golang web 極速開發(fā)框架。

          使用:

          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")
          }
          瀏覽 18
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  深爱激情综合网 | 日韩网站在线 | 亚洲精品国产精品自产 | 亚洲ⅴ国产v天堂a无码二区 | 国产成人无码A片免费看玄火 |