Backbone と Yii Framework を使用して、最初の RESTful アプリを作成しようとしています。GET メソッドには問題はありませんでしたが、新しい要素を作成するために POST メソッドに行き詰まっています。
Backbone に Comment モデルがあります。
var commentModel = Backbone.Model.extend({
    urlRoot: "index.php/api/comments",
    idAttribute: 'id',
    defaults: {
        content: "Empty comment",
        status: 1
    }
});
私の見解では、相対形式から値を渡す新しいコメントを作成する関数を追加します。
on_submit: function(e) {
            var new_comment = new Comment({author_id: this.$('#author_text').val(), content: this.$('#content_text').val(), post_id: this.$("#post_text").val(), status: this.$("#status_text").val()});
         new_comment.save();
        },
Firebug でリクエストを見ると、問題ないようです。[POST] タブで、すべての値を確認できます。
JSON            
author_id "7"   
content "Epic fail"
post_id "7" 
status "2"
Source 
{"content":"Epic fail","status":"2","author_id":"7","post_id":"7"}
しかし、私のphp Apiでは、 $_POST 変数は空です!
foreach($_POST as $var=>$value) {
     if($model->hasAttribute($var))
        $model->$var = $value;
     else
        $this->_sendResponse(500);
}
誰にもいくつかのアイデアがありますか?Backbone.Sync のドキュメントを読んで、作成要求に POST を使用する必要があることを理解しています。
以下から値を取得する回避策を見つけました。
file_get_contents('php://input') 
しかし、idは私には適切ではありません...
ありがとう。