<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                基本函數 變量可以使用符號 | 在函數間傳遞 {{.Con | markdown | addlinks}} {{.Name | printf "%s"}} 使用括號 {{printf "nums is %s %d" (printf "%d %d" 1 2) 3}} 代碼實現: ~~~ |-- admin | |--controllers | `-- user.go ~~~ ~~~ package admin import ( "fmt" "net/url" "github.com/astaxie/beego" ) type UserController struct { beego.Controller } func (this *UserController) Index() { // 函數 and , 函數 or this.Data["x"] = "x" this.Data["y"] = "y" this.Data["z"] = "z" // 函數 call this.Data["dump"] = fmt.Println this.Data["arg1"] = 1 this.Data["arg2"] = 2 // 函數 index this.Data["index"] = map[string]string{"this": "is", "function": "index"} // 函數 len this.Data["len"] = [10]int{} // 函數 not this.Data["not1"] = true this.Data["not2"] = false this.Data["not3"] = "not" this.Data["not4"] = "true" // 函數 urlquery urlencode, _ := url.ParseQuery("http://beego.me") this.Data["urlencode"] = urlencode.Encode() this.TplName = "admin/user/index.html" } ~~~ ~~~ |-- views | |--admin | |--user | `-- index.html ~~~ ~~~ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> this is view admin/user/index.html <br/> 函數 and :<br/> <!-- and 會逐一判斷每個參數,將返回第一個為空的參數,否則就返回最后一個非空參數 --> { {and .a .b .c} } 返回空 {{and .a .b .c}}<br/> { {and .x .y .z} } 返回最后一個非空值 {{and .x .y .z}}<br/> 函數 or :<br/> <!-- or 會逐一判斷每個參數,將返回第一個非空的參數,否則就返回最后一個參數 --> { {and .a .b .c} } 返回最后一個參數 {{and .a .b .c}}<br/> { {and .x .y .z} } 返回第一個非空的參數 {{and .x .y .z}}<br/> 函數 call :<br/> <!-- call 可以調用函數,并傳入參數 調用的函數需要返回 1 個值 或者 2 個值,返回兩個值時,第二個值用于返回 error 類型的錯誤。返回的錯誤不等于 nil 時,執行將終止。 --> {{call .dump .arg .arg}}<br/> 函數 index :<br/> <!-- index 支持 map, slice, array, string,讀取指定類型對應下標的值 --> { {index .index "function"} } 下標對應的值是: {{index .index "function"}}<br/> 函數 len :<br/> <!-- 返回對應類型的長度,支持類型:map, slice, array, string, chan --> {{printf "The len length is %d" (.len|len)}}<br/> 函數 not :<br/> <!-- not 返回輸入參數的否定值,if true then false else true --> not1 : {{not .not1}}<br/> not2 : {{not .not2}}<br/> not3 : {{not .not3}}<br/> not4 : {{not .not4}}<br/> 函數 print 對應 fmt.Sprint<br/> 函數 printf 對應 fmt.Sprintf<br/> 函數 println 對應 fmt.Sprintln<br/> {{printf "x => %s , y => %s , z => %v\n" .x .y .z}} 函數 urlquery :<br/> {{urlquery "http://beego.me"}}<br/> url.Encode() => {{.urlencode}}<br/> 函數 eq / ne / lt / le / gt / ge 這類函數一般配合在 if 中使用 </body> </html> ~~~
                  <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>

                              哎呀哎呀视频在线观看