My problem occurs with the following code:
<?php
echo $this->Form->create(
'Page',
array(
'url' => array(
'controller' => 'pages',
'action' => 'delete',
$this->request->data['Page']['id'],
'admin' => true
),
'id' => 'PageDeleteForm',
'method' => 'POST',
'class' => 'hide'
)
);
echo $this->Form->end();
?>
The result of this is as follows:
<form action="/admin/pages/delete/16" id="PageDeleteForm" method="post" class="hide" accept-charset="utf-8">
<div style="display:none;">
<input type="hidden" name="_method" value="PUT">
</div>
</form>
CakePHP returns me: Method not allowed , since my action
only allows POST
or DELETE
.
Why is the _method
field being generated with the value PUT ?