{"id":106,"date":"2019-11-12T14:55:14","date_gmt":"2019-11-12T05:55:14","guid":{"rendered":"https:\/\/ta539.com\/bokumemo\/?p=106"},"modified":"2019-11-12T14:55:14","modified_gmt":"2019-11-12T05:55:14","slug":"cakephp3-formhelper","status":"publish","type":"post","link":"https:\/\/ta539.com\/bokumemo\/2019\/11\/12\/cakephp3-formhelper\/","title":{"rendered":"cakephp3 FormHelper"},"content":{"rendered":"<p>\u25a0control<br \/>\n$this-&gt;Form-&gt;control(&#8216;item_category_id&#8217;, [&#8216;label&#8217; =&gt; [&#8216;text&#8217; =&gt; &#8216;\u30ab\u30c6\u30b4\u30ea\u30fc\u9078\u629e&#8217;], &#8216;options&#8217; =&gt; $itemCategories])<\/p>\n<p>\u25a0input<br \/>\n$this-&gt;Form-&gt;input($key . &#8216;.no&#8217;, array_merge($input_set, [&#8216;oninput&#8217; =&gt; &#8216;input_set(&#8216; . $key . &#8216;)&#8217;]))<\/p>\n<p>\u25a0hidden<br \/>\n$this-&gt;Form-&gt;hidden(&#8216;chk_flg_&#8217; . $key, [&#8216;value&#8217; =&gt; 0])<\/p>\n<p>\u25a0checkbox<br \/>\n$this-&gt;Form-&gt;checkbox(&#8216;all&#8217;, [&#8216;style&#8217;=&gt; &#8216;margin:0 0 0 0;&#8217;, &#8216;hiddenField&#8217; =&gt; false, &#8216;checked&#8217; =&gt; false, &#8216;onClick&#8217; =&gt; &#8216;allchk(&#8220;item_chk[]&#8221;);&#8217;])<\/p>\n<p>\u25a0image<br \/>\n$this-&gt;Html-&gt;image(&#8220;upload_img\/&#8221; . $item-&gt;image, [&#8216;style&#8217; =&gt; &#8216;width:100px;height:auto;&#8217;])<\/p>\n<p>\u25a0link<br \/>\n$this-&gt;Html-&gt;link(&#8216;\u3010\u30ab\u30fc\u30c8\u3092\u78ba\u8a8d\u3011&#8217;, [&#8216;controller&#8217; =&gt; &#8216;Carts&#8217;, &#8216;action&#8217; =&gt; &#8216;index&#8217;])<\/p>\n<p>\u25a0postLink<br \/>\n$this-&gt;Form-&gt;postLink(&#8216;\u524a\u9664&#8217;, [&#8216;action&#8217; =&gt; &#8216;delete&#8217;, $item-&gt;id], [&#8216;confirm&#8217; =&gt; __(&#8216;\u524a\u9664\u3057\u307e\u3059 # {0}?&#8217;, $item-&gt;name)])<\/p>\n<p>\u25a0button<br \/>\n$this-&gt;Form-&gt;button(&#8216;\u623b\u308b&#8217;, [&#8216;name&#8217; =&gt; &#8216;back&#8217;, &#8216;style&#8217; =&gt; &#8216;margin-right:1rem;&#8217;])<\/p>\n<p>\u25a0element<br \/>\n$this-&gt;element(&#8216;menu\/menu&#8217;)<\/p>\n<p>\u25a0\u89aa\u30c6\u30fc\u30d6\u30eb\u306e\u5024<br \/>\nh($item-&gt;item_category-&gt;name)<\/p>\n<p>\u25a0create<br \/>\n&lt;?= $this-&gt;Form-&gt;create(null, [&#8216;url&#8217; =&gt; [&#8216;action&#8217; =&gt; $act], &#8216;name&#8217; =&gt; &#8216;index&#8217;]) ?&gt;&lt;?= $this-&gt;Form-&gt;end() ?&gt;<\/p>\n<p>\u25a0foreach<br \/>\n&lt;?php foreach ($items as $key =&gt; $item): ?&gt;&lt;?php endforeach; ?&gt;<\/p>\n<p>\u25a0if<br \/>\n&lt;?php if ($item-&gt;flg == 0): ?&gt;\u3042\u308a&lt;?php else: ?&gt;\u306a\u3057&lt;?php endif; ?&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u25a0control $this-&gt;Form-&gt;control(&#8216;item_category_id&#8217;, [&#8216;label&#8217; =&gt; [&#8216;text&#8217; =&gt; &#8216;\u30ab\u30c6\u30b4\u30ea\u30fc\u9078\u629e&#8217;], &#8216;options&#8217; =&gt; $itemCategories]) \u25a0input $this-&gt;Form-&gt;input($key . &#8216;.no&#8217;, array_merge($input_set, [&#8216;oninput&#8217; =&gt; &#8216;input_set(&#8216; . $key . &#8216;)&#8217;])) \u25a0hidden $this-&gt;Form-&gt;hidden(&#8216;chk_flg_&#8217; . $key, [&#8216;value&#8217; =&gt; 0]) \u25a0checkbox $this-&gt;Form-&gt;checkbox(&#8216;all&#8217;, [&#8216;style&#8217;=&gt; &#8216;margin:0 0 0 0;&#8217;, &#8216;hiddenField&#8217; =&gt; false, &#8216;checked&#8217; =&gt; false, &#8216;onClick&#8217; =&gt; &#8216;allchk(&#8220;item_chk[]&#8221;);&#8217;]) \u25a0image $this-&gt;Html-&gt;image(&#8220;upload_img\/&#8221; . $item-&gt;image, [&#8216;style&#8217; =&gt; &#8216;width:100px;height:auto;&#8217;]) \u25a0link $this-&gt;Html-&gt;link(&#8216;\u3010\u30ab\u30fc\u30c8\u3092\u78ba\u8a8d\u3011&#8217;, [&#8216;controller&#8217; =&gt; &#8216;Carts&#8217;, &#8216;action&#8217; =&gt; &#038;#82<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11],"tags":[12],"class_list":["post-106","post","type-post","status-publish","format-standard","hentry","category-11","tag-cakephp"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ta539.com\/bokumemo\/wp-json\/wp\/v2\/posts\/106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ta539.com\/bokumemo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ta539.com\/bokumemo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ta539.com\/bokumemo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ta539.com\/bokumemo\/wp-json\/wp\/v2\/comments?post=106"}],"version-history":[{"count":0,"href":"https:\/\/ta539.com\/bokumemo\/wp-json\/wp\/v2\/posts\/106\/revisions"}],"wp:attachment":[{"href":"https:\/\/ta539.com\/bokumemo\/wp-json\/wp\/v2\/media?parent=106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ta539.com\/bokumemo\/wp-json\/wp\/v2\/categories?post=106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ta539.com\/bokumemo\/wp-json\/wp\/v2\/tags?post=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}