{"id":207408,"date":"2025-07-08T10:34:59","date_gmt":"2025-07-08T02:34:59","guid":{"rendered":"https:\/\/server.hk\/cnblog\/207408\/"},"modified":"2025-07-08T10:34:59","modified_gmt":"2025-07-08T02:34:59","slug":"%e5%a6%82%e4%bd%95%e6%a3%80%e7%b4%a2%e6%a3%80%e6%9f%a5%e7%9a%84%e5%80%bc","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/207408\/","title":{"rendered":"\u5982\u4f55\u68c0\u7d22\u68c0\u67e5\u7684\u503c"},"content":{"rendered":"<p><b><\/b> <\/p>\n<p>\u5f53\u524d\u4f4d\u7f6e\uff1a <span>&gt;<\/span> <span>&gt;<\/span> <span>&gt;<\/span> <span>&gt;<\/span> <span>\u5982\u4f55\u68c0\u7d22\u68c0\u67e5\u7684\u503c<\/span><\/p>\n<p><span>\u6765\u6e90\uff1astackoverflow<\/span><br \/>\n<span>2024-04-22 12:54:35<\/span><br \/>\n<span><i><\/i>0\u6d4f\u89c8<\/span><br \/>\n<span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u4eca\u5929\u5c06\u7ed9\u5927\u5bb6\u5e26\u6765<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u5982\u4f55\u68c0\u7d22\u68c0\u67e5\u7684\u503c\u300b<\/span>\uff0c\u611f\u5174\u8da3\u7684\u670b\u53cb\u8bf7\u7ee7\u7eed\u770b\u4e0b\u53bb\u5427\uff01\u4ee5\u4e0b\u5185\u5bb9\u5c06\u4f1a\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u4f60\u662f\u6b63\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">Golang<\/span>\u6216\u8005\u5df2\u7ecf\u662f\u5927\u4f6c\u7ea7\u522b\u4e86\uff0c\u90fd\u975e\u5e38\u6b22\u8fce\u4e5f\u5e0c\u671b\u5927\u5bb6\u90fd\u80fd\u7ed9\u6211\u5efa\u8bae\u8bc4\u8bba\u54c8~\u5e0c\u671b\u80fd\u5e2e\u52a9\u5230\u5927\u5bb6\uff01<\/p>\n<p> \u95ee\u9898\u5185\u5bb9<br \/>\n <\/p>\n<p>\u901a\u8fc7\u8fd9\u4e2a\u7ed9\u5b9a\u7684 html \u4ee3\u7801\uff0c\u6211\u80fd\u591f\u6dfb\u52a0\u4e00\u4e2a\u7b80\u5355\u7684 javascript \u51fd\u6570\u6765\u9a8c\u8bc1\u662f\u5426\u81f3\u5c11\u9009\u4e2d\u4e86\u4e00\u4e2a\u590d\u9009\u6846\u3002<\/p>\n<p>\u73b0\u5728\u4e8b\u5b9e\u8bc1\u660e\uff0c\u5373\u4f7f\u6240\u6709\u4e09\u4e2a\u590d\u9009\u6846\u90fd\u88ab\u9009\u4e2d\uff0c\u6211\u4e5f\u53ea\u6536\u5230\u7b2c\u4e00\u4e2a\u9009\u4e2d\u7684\u590d\u9009\u6846\u7684\u503c\u3002<\/p>\n<p><strong>html<\/strong>\uff1a<\/p>\n<pre>&lt;label class=\"foo\"&gt;\n       &lt;input type=\"checkbox\" name=\"bar[]\" value=\"w01\"&gt;\n       &lt;span class=\"label-body\"&gt;apple&lt;\/span&gt;\n&lt;\/label&gt;\n&lt;label class=\"foo\"&gt;\n       &lt;input type=\"checkbox\" name=\"bar[]\" value=\"w02\"&gt;\n       &lt;span class=\"label-body\"&gt;banana&lt;\/span&gt;\n&lt;\/label&gt;\n&lt;label class=\"foo\"&gt;\n       &lt;input type=\"checkbox\" name=\"bar[]\" value=\"w03\"&gt;\n       &lt;span class=\"label-body\"&gt;melon&lt;\/span&gt;\n&lt;\/label&gt;<\/pre>\n<p><strong>\u63a7\u5236\u5668<\/strong>\uff1a<\/p>\n<pre>func (this *SendController) Post() {\n\n    beego.Info(this.GetString(\"bar[]\"))\n    \/\/ ...\n}<\/pre>\n<p>\u5982\u4f55\u83b7\u53d6\u6240\u6709\u9009\u5b9a\u590d\u9009\u6846\u7684\u5217\u8868\uff0c\u5373\u3002 w01 &amp; w03\uff1f<\/p>\n<p>\u5956\u52b1\u95ee\u9898\uff1a <code>this.getstring(\"foo\")<\/code> \u548c <code>this.input().get(\"foo\")<\/code> \u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/p>\n<p> <\/p>\n<h2>\u89e3\u51b3\u65b9\u6848<\/h2>\n<p> <\/p>\n<p>\u4f60\u53ef\u4ee5\u8fd9\u6837\u83b7\u53d6\u6570\u7ec4\u53c2\u6570<\/p>\n<p>bars := this.GetStrings(&#8220;bar&#8221;) <\/p>\n<\/p>\n<p>\u4eca\u5929\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff1b\u5173\u4e8eGolang\u7684\u6280\u672f\u77e5\u8bc6\u6211\u4eec\u4f1a\u4e00\u70b9\u70b9\u6df1\u5165\u4ecb\u7ecd\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u516c\u4f17\u53f7\uff0c\u4e00\u8d77\u5b66\u4e60\u7f16\u7a0b~<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u524d\u4f4d\u7f6e\uff1a &gt; &gt; &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-207408","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/207408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=207408"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/207408\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=207408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=207408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=207408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}