]> dev.renevier.net Git - syj.git/blobdiff - application/controllers/helpers/SyjApi.php
redirection after path creation is decided by server (php), not guessed by client...
[syj.git] / application / controllers / helpers / SyjApi.php
index 86ea00e3ff1cdc6fa6355843e81b5d164bddc496..37b010afcc95146b64f897fc53de3183a79136e4 100644 (file)
@@ -27,6 +27,11 @@ class Syj_Controller_Action_Helper_SyjApi extends Zend_Controller_Action_Helper_
         $this->_contentType = $contentType;
     }
 
+    public function setBodyJson($data) {
+        $this->setBody(json_encode($data))
+             ->setContentType('application/json');
+    }
+
     public function setBody($body) {
         $this->_body = (string)$body;
         return $this;