{"id":3258,"date":"2022-06-22T03:28:21","date_gmt":"2022-06-21T18:28:21","guid":{"rendered":"https:\/\/417.run\/?p=3258"},"modified":"2022-06-22T03:28:35","modified_gmt":"2022-06-21T18:28:35","slug":"postlink-error","status":"publish","type":"post","link":"https:\/\/417.run\/pg\/php\/cakephp4\/postlink-error\/","title":{"rendered":"CakePHP4\u3067postLink\u3057\u305f\u3089\u3001\u30a8\u30e9\u30fc\u3067\u305f\u3002Cannot read properties of undefined (reading &#8216;submit&#8217;)"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/417.run\/wp-content\/uploads\/2022\/06\/image-1655836093942.png\" alt=\"file\" \/><br \/>\nCakePHP4\u3067postLink\u3057\u305f\u3089\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<h2>Cannot read properties of undefined (reading 'submit')<\/h2>\n<p>\u539f\u56e0\u306fForm\u306e\u4e2d\u3067postLink\u3092\u3059\u308b\u3068\u51fa\u3066\u3057\u307e\u3046\u307f\u305f\u3044\u3002<\/p>\n<h2>\u5bfe\u51e6\u65b9\u6cd5<\/h2>\n<ol>\n<li><code>block =&gt; true<\/code>\u3092\u3064\u3051\u308b<\/li>\n<li>form\u306e\u5916\u306b\u3001<code>$this-&gt;fetch(&#039;postLink&#039;)<\/code>\u3092\u8ffd\u52a0\u3059\u308b<\/li>\n<\/ol>\n<p>\u3053\u306e\u4e8c\u3064\u3092\u3084\u308b\u3068\u76f4\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre><code class=\"language-php\">&lt;?= $this-&gt;Form-&gt;create($hoge, [&#039;type&#039; =&gt; &#039;file&#039;]) ?&gt;\n&lt;?= $this-&gt;Form-&gt;postLink(__(&#039;\u524a\u9664&#039;),\n  [&#039;action&#039; =&gt; &#039;delete&#039;, $project-&gt;id],\n  [&#039;block&#039; =&gt; true, &#039;confirm&#039; =&gt; __(&#039;\u524a\u9664\u3057\u307e\u3059\u304b\uff1f&#039;)]\n  )\n?&gt;\n&lt;?= $this-&gt;Form-&gt;button(__(&#039;\u4fdd\u5b58&#039;)) ?&gt;\n&lt;?= $this-&gt;Form-&gt;end() ?&gt;\n&lt;?= $this-&gt;fetch(&#039;postLink&#039;) ?&gt;<\/code><\/pre>\n<p>\u5916\u306b\u51fa\u3057\u3066form\u9001\u4fe1\u306b\u306a\u3089\u306a\u3044\u3088\u3046\u306bcake\u304c\u3057\u3066\u304f\u308c\u3066\u308b\u3093\u3067\u3059\u306d\u3001\u4fbf\u5229\u4fbf\u5229<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CakePHP4\u3067postLink\u3057\u305f\u3089\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u304d\u307e\u3057\u305f\u3002 Cannot read properties of undefined (reading &#8216;submit&#8217;) \u539f\u56e0\u306fForm\u306e\u4e2d\u3067postLink\u3092\u3059\u308b\u3068\u51fa &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":{"0":"post-3258","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-cakephp4","7":"nothumb"},"_links":{"self":[{"href":"https:\/\/417.run\/wp-json\/wp\/v2\/posts\/3258"}],"collection":[{"href":"https:\/\/417.run\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/417.run\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/417.run\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/417.run\/wp-json\/wp\/v2\/comments?post=3258"}],"version-history":[{"count":3,"href":"https:\/\/417.run\/wp-json\/wp\/v2\/posts\/3258\/revisions"}],"predecessor-version":[{"id":3263,"href":"https:\/\/417.run\/wp-json\/wp\/v2\/posts\/3258\/revisions\/3263"}],"wp:attachment":[{"href":"https:\/\/417.run\/wp-json\/wp\/v2\/media?parent=3258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/417.run\/wp-json\/wp\/v2\/categories?post=3258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/417.run\/wp-json\/wp\/v2\/tags?post=3258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}