<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # View 編寫 在前面編寫 Controller 的時候,我們在 Get 里面寫過這樣的語句 `this.TplName = "index.tpl"`,設置顯示的模板文件,默認支持 `tpl` 和 `html` 的后綴名,如果想設置其他后綴你可以調用 `beego.AddTemplateExt` 接口設置,那么模板如何來顯示相應的數據呢?beego 采用了 Go 語言默認的模板引擎,所以和 Go 的模板語法一樣,Go 模板的詳細使用方法請參考[《Go Web 編程》模板使用指南](https://github.com/astaxie/build-web-application-with-golang/blob/master/zh/07.4.md) 我們看看快速入門里面的代碼(去掉了 css 樣式): ``` <!DOCTYPE html> <html> <head> <title>Beego</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <header class="hero-unit" style="background-color:#A9F16C"> <div class="container"> <div class="row"> <div class="hero-text"> <h1>Welcome to Beego!</h1> <p class="description"> Beego is a simple & powerful Go web framework which is inspired by tornado and sinatra. <br /> Official website: <a href="http://{{.Website}}">{{.Website}}</a> <br /> Contact me: {{.Email}} </p> </div> </div> </div> </header> </body> </html> ``` 我們在 Controller 里面把數據賦值給了 data(map 類型),然后我們在模板中就直接通過 key 訪問 `.Website` 和 `.Email` 。這樣就做到了數據的輸出。接下來我們講解如何讓靜態文件輸出。 [靜態文件處理](static.md)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看