]> dev.renevier.net Git - syj.git/commitdiff
SyjNoRender helper
authorArno Renevier <arno@renevier.net>
Wed, 28 Dec 2011 17:10:23 +0000 (18:10 +0100)
committerArno Renevier <arno@renevier.net>
Wed, 28 Dec 2011 17:22:56 +0000 (18:22 +0100)
application/controllers/helpers/SyjApi.php
application/controllers/helpers/SyjNoRender.php [new file with mode: 0644]

index 6016f99a75c6d76a8aa5a2102729396fad63ef89..029fe90275eb79d3db7a7b026083265c6bedabb0 100644 (file)
@@ -11,12 +11,7 @@ class Syj_Controller_Action_Helper_SyjApi extends Zend_Controller_Action_Helper_
     protected $_redirect = '';
 
     public function init() {
-        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
-        $viewRenderer->setNoRender();
-        $layout = Zend_Layout::getMvcInstance();
-        if (null !== $layout) {
-            $layout->disableLayout();
-        }
+        $this->getActionController()->getHelper('SyjNoRender')->disableRender();
     }
 
     public function setContentType($contentType) {
diff --git a/application/controllers/helpers/SyjNoRender.php b/application/controllers/helpers/SyjNoRender.php
new file mode 100644 (file)
index 0000000..df0ef90
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+/*  This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
+    and is published under the AGPL license. */
+
+class Syj_Controller_Action_Helper_SyjNoRender extends Zend_Controller_Action_Helper_Abstract
+{
+
+    public function disableRender() {
+        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
+        $viewRenderer->setNoRender();
+        $layout = Zend_Layout::getMvcInstance();
+        if (null !== $layout) {
+            $layout->disableLayout();
+        }
+    }
+
+}