title: How can use edit form only post method using cakePHP 2.x?
body: <p>I am using CakePHP 2.x. When I submit an edit form it not work for following code:</p>
  
  <pre><code>if ($this-&gt;request-&gt;is(array('post'))) {
      ...
  
      if ($this-&gt;User-&gt;save($this-&gt;request-&gt;data)) {
          ...
      } else {
          ...
      }
  } else {
      ...
  }
  </code></pre>
  
  <p>But it work for following code:</p>
  
  <pre><code>if ($this-&gt;request-&gt;is(array('post','put'))) { //change made here
      ...
  
      if ($this-&gt;User-&gt;save($this-&gt;request-&gt;data)) {
          ...
      } else {
          ...
      }
  } else {
      ...
  }
  </code></pre>
  
  <p>But I want my code work only for first code. Please help me if you have any solution.</p>
  
  <p><strong>EDIT :</strong>
  Note that, when we create a from using CakePHP each time it's create a hidden input variable name <strong>_method</strong> which value set <strong>POST</strong> on add form and <strong>PUT</strong> on edit form. CakePHP request handler work with <strong>_method</strong> variable, not on form type attributes.</p>