fabpot/Silex — pull request #378 by fabpot (2012-06-17 15:26:03+00:00)
Title: PHP 5.4

This is a first attempt to provide useful shortcut methods on the Application class via traits. It also contains a `secure` method for routes.

Here is how you can make use of these features on PHP 5.4:

class MyApp extends Application
{
use Application\TwigTrait;
use Application\SecurityTrait;
use Application\FormTrait;
use Application\UrlGeneratorTrait;
use Application\SwiftmailerTrait;
use Application\MonologTrait;
use Application\TranslationTrait;
}

class MyRoute extends Route
{
use Route\SecurityTrait;
}

$app = new MyApp();
$app['route_factory'] = function () use ($app) {
return new MyRoute();
};

This PR depends on #376.