title: Can I cancel a Zend Controller action in the init() method?
body: <p>During <code>Zend_Controller_Action::init()</code>, is there a way to cancel the action (so it won't be called)?</p>
  
  <pre><code>&lt;?php
  class JsonApiController extends Zend_Controller_Action {
      function init()
      {
          // try JSON decoding the raw request body
          if ($jsonDecodingFailed) {
              echo '{"error":"invalid JSON"}';
              $this-&gt;_cancelAction(); // something like this exist?
          }
      }
  }
  </code></pre>
  
  <p>My current workaround is to make an empty <code>nullAction()</code> method and call <code>$this-&gt;_forward('null')</code> to forward to it.</p>