diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-25 00:53:45 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-25 00:53:45 +0000 |
commit | d62acf041f9a880f1762c5a29e8b11133b651ff5 (patch) | |
tree | ae895af486128fd646c691bd237187696e3d1032 | |
parent | 0bb82b76216d033742afab91ce9e9a20dd607ad8 (diff) |
Be consistent: resource is a url, data is the actual JSON encoded result.
-rw-r--r-- | modules/comment/controllers/comments.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php index 8c3f8428..2f5c902f 100644 --- a/modules/comment/controllers/comments.php +++ b/modules/comment/controllers/comments.php @@ -86,7 +86,7 @@ class Comments_Controller extends REST_Controller { */ public function _show($comment) { if (rest::output_format() == "json") { - print json_encode(array("result" => "success", "resource" => $comment)); + print json_encode(array("result" => "success", "data" => $comment)); } else { $view = new View("comment.html"); $view->comment = $comment; @@ -116,7 +116,7 @@ class Comments_Controller extends REST_Controller { } else { print json_encode( array("result" => "error", - "html" => $form)); + "html" => $form->__toString())); } } @@ -128,8 +128,7 @@ class Comments_Controller extends REST_Controller { rest::http_content_type(rest::JSON); $comment->delete(); - print json_encode( - array("result" => "success")); + print json_encode(array("result" => "success")); } /** |