title: Silex application before middleware cancel route
body: <p>I can't found the way to cancel the action inside a "Before Middleware" and send the response to the cliente without execute the controller.</p>
  
  <p>For example:</p>
  
  <pre><code>$app-&gt;before( function( Request $request ) {
      // Do something here
      // ...
      // Here sent the response to the client and don't execute the controller
  }});
  </code></pre>
  
  <p>Is possible?</p>
  
  <p><strong>One example</strong></p>
  
  <p>This code works fine. I'm looking for another solution using the framework built-in methods. If no possible, no problem.</p>
  
  <pre><code>$app-&gt;before( function( Request $request ) {
      // Do something here
      // ...
  
      header( 'Content-Type: application/json' );
  
      echo json_encode( array(
          'message' =&gt; 'Invalid token'
      ) );
  
      http_response_code( 400 ); // This code return Bad Request to client
      exit; // Cancel the rest of the framework
  }});
  </code></pre>