{"id":1597,"date":"2022-05-18T14:54:24","date_gmt":"2022-05-18T06:54:24","guid":{"rendered":"https:\/\/qishiya.com\/?p=1597"},"modified":"2022-05-18T14:54:24","modified_gmt":"2022-05-18T06:54:24","slug":"golang-%e6%a8%a1%e6%9d%bf%e4%bd%bf%e7%94%a8%e7%ac%94%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/qishiya.com\/?p=1597","title":{"rendered":"Golang \u6a21\u677f\u4f7f\u7528\u7b14\u8bb0"},"content":{"rendered":"\n<p>\u56e0\u4e3a\u4f7f\u7528\u8fc7 php \u7684\u6a21\u677f\u5f15\u64ce\uff0c\u6bd4\u5982 Smarty\uff0c\u6240\u4ee5\u5728 Golang \u4e2d\u4f7f\u7528\u6a21\u677f\u5f15\u64ce\uff08html\/template\uff09\uff0c\u4e5f\u4f1a\u5e26\u6709 php \u6a21\u677f\u5f15\u64ce\u7684\u601d\u7ef4\uff0c\u5f88\u96be\u5207\u6362\u8fc7\u6765\uff0c\u5728\u4f7f\u7528\u8fc7\u7a0b\u9047\u5230\u4e0d\u5c11\u95ee\u9898\uff0c\u6574\u7406\u5982\u4e0b\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_61 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #ff6200;color:#ff6200\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #ff6200;color:#ff6200\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/qishiya.com\/?p=1597\/#%E5%BE%AA%E7%8E%AF%E5%B5%8C%E5%A5%97\" title=\"\u5faa\u73af\u5d4c\u5957\">\u5faa\u73af\u5d4c\u5957<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/qishiya.com\/?p=1597\/#if_%E6%98%AF%E5%87%BD%E6%95%B0\" title=\"if \u662f\u51fd\u6570\">if \u662f\u51fd\u6570<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%BE%AA%E7%8E%AF%E5%B5%8C%E5%A5%97\"><\/span>\u5faa\u73af\u5d4c\u5957<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5728 Golang \u7684\u6a21\u677f\u5f15\u64ce\u4e2d\uff0c\u5faa\u73af\u5d4c\u5957\u7684\u5199\u6cd5\u662f\u8981\u505a\u7279\u6b8a\u5904\u7406\u7684\uff0c\u4e0d\u7136\u4f1a\u62a5\u9519\uff0c\u5c31\u662f\u5185\u5faa\u73af\u8981\u7279\u6b8a\u5904\u7406\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"https:\/\/tutu-1252436247.cos.ap-beijing.myqcloud.com\/2022\/05\/202205187J1dTy.png\" alt=\"202205187J1dTy\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u8981\u52a0\u4e00\u4e2a <code>$<\/code> \u7b26\u53f7\uff0c\u539f\u56e0\u6ca1\u6709\u5177\u4f53\u7684\u53bb\u67e5\uff0c\u6211\u4e5f\u662f Google \u67e5\u5230\u7684\u3002<\/p><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"if_%E6%98%AF%E5%87%BD%E6%95%B0\"><\/span>if \u662f\u51fd\u6570<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"https:\/\/tutu-1252436247.cos.ap-beijing.myqcloud.com\/2022\/05\/20220518UmLH50.png\" alt=\"20220518UmLH50\"\/><\/figure>\n\n\n\n<p>\u548c php smarty \u4e0d\u540c\u7684\u662f\uff0cif \u540e\u9762\u63a5\u6bd4\u8f83\u7b26\uff0c\u7136\u540e\u518d\u63a5\u53c2\u6570\uff0c\u76f4\u63a5\u5199\u8868\u8fbe\u793a\u662f\u4f1a\u62a5\u9519\u7684\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/socketloop.com\/tutorials\/golang-executing-and-evaluating-nested-loop-in-html-template\">Golang : Executing and evaluating nested loop in html template (socketloop.com)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u56e0\u4e3a\u4f7f\u7528\u8fc7 php \u7684\u6a21\u677f\u5f15\u64ce\uff0c\u6bd4\u5982 Smarty\uff0c\u6240\u4ee5\u5728 Golang \u4e2d\u4f7f\u7528\u6a21\u677f\u5f15\u64ce\uff08html\/template\uff09\uff0c\u4e5f\u4f1a\u5e26\u6709 php \u6a21\u677f\u5f15\u64ce\u7684\u601d\u7ef4\uff0c\u5f88\u96be\u5207\u6362\u8fc7\u6765\uff0c\u5728\u4f7f\u7528\u8fc7\u7a0b\u9047\u5230\u4e0d\u5c11\u95ee\u9898\uff0c\u6574\u7406\u5982\u4e0b\u3002 \u5faa\u73af\u5d4c\u5957 \u5728 Golang \u7684\u6a21\u677f\u5f15 &#8230; <a title=\"Golang \u6a21\u677f\u4f7f\u7528\u7b14\u8bb0\" class=\"read-more\" href=\"https:\/\/qishiya.com\/?p=1597\" aria-label=\"\u66f4\u591a Golang \u6a21\u677f\u4f7f\u7528\u7b14\u8bb0\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"templates\/template-full-width.php","format":"standard","meta":{"footnotes":""},"categories":[362],"tags":[363,364],"class_list":["post-1597","post","type-post","status-publish","format-standard","hentry","category-golang","tag-golang","tag-364"],"_links":{"self":[{"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/posts\/1597","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1597"}],"version-history":[{"count":0,"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/posts\/1597\/revisions"}],"wp:attachment":[{"href":"https:\/\/qishiya.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}