Splash now supports StackPHP Middlewares

Starting with Splash 5, Splash (Mouf's MVC framework) is gaining support for StackPHP HTTP middlewares!

This means you can now add any of the great middlewares referenced on StackPHP's website directly in your Mouf application.

And because dependency injection is done graphically in Mouf, you can actually drag'n'drop middlewares to create your middleware's stack. Have a look at the call stack displayed graphically in your 'splash' instance. It just makes sense :)

Also, the Splash router and Splash error handling are now middlewares too, and there will soon be more to come!

In related news, controllers written using Splash 5+ can now return Symfony 2 Response objects, so you can now write things like:

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;

class MyController extends Controller {

    /**
     * Returning a Response object
     *
     * @URL /myurl1
     */
    public function test() {
         return new Response('Hello World', 200, array('content-type' => 'text/html'));
    }

    /**
     * Returning a JSON response
     *
     * @URL /myjsonurl
     */
    public function testJson() {
         return new JsonResponse({ "status" => "ok", "message" => "Hello world!" });
    }
}

Hope you will enjoy these changes!