title: How to end the execution of an action via an event
body: <p>in my ZF2 application I am adding the following event listener, however I want to make the execution of the action actually stop, however this doesnt happen. </p>
  
  <pre><code> public function setEventManager(EventManagerInterface $events)
      {
          parent::setEventManager($events);
  
          $controller = $this;
          $events-&gt;attach('dispatch', function ($e) use ($controller) {
              $request = $e-&gt;getRequest();
              $method = $request-&gt;getMethod();
              $headers = $request-&gt;getHeaders();
  
              // If we get here, based on some conditions, the original intended action must return a new JsonViewModel()...
              return new JsonViewModel([]); // However, this doesn't do anything.
          }, 100); // execute before executing action logic
      }
  </code></pre>