私のアプリは PUT アクションを完全に無視しているようです。REST を使用した GET、POST、PUT、および DELETE アクションを備えたコントローラーがあります。PUT メソッドと DELETE メソッドの両方が無視されているようです。おそらく、アクションとメソッドの構文の問題でしょうか?
とにかく、ここにいくつかのサンプルコードがあります:
public function init()
{
// Set the method for the display form to PUT
$this->setMethod('PUT');
$this->setAction('/article/?update');
}
コントローラーから:
public function putAction()
{
echo "putAction";exit();
}
私の .htaccess では、すべての GET POST PUT DELETE からも許可します
私は混乱しています、それは機能していません。助けてください、ありがとう!
これは次の形式です。
<form articleid="17" articlename="1" articlecontent="1" topicidfk="1" topicid="1" topicname="Sports" method="put" action="/article?update"><dl class="zend_form">
<dt id="articlename-label"><label for="articlename" class="required">Article Name</label></dt>
<dd id="articlename-element">
<input type="text" name="articlename" id="articlename" value="1" /></dd>
<dt id="articlecontent-label"><label for="articlecontent" class="required">Article Content</label></dt>
<dd id="articlecontent-element">
<textarea name="articlecontent" id="articlecontent" rows="4" cols="80">1</textarea></dd>
<dt id="topicidfk-label"> </dt>
<dd id="topicidfk-element">
<select name="topicidfk" id="topicidfk">
<option value="0" label="Select One">Select One</option>
<option value="1" label="Sports" selected="selected">Sports</option>
<option value="2" label="Finance">Finance</option>
</select></dd>
<dt id="submit-label"> </dt><dd id="submit-element">
<input type="submit" name="submit" id="submit" value="Update Article" /></dd></dl></form>