1.4.0
- #9 and #10: PHP-DI now resolves middlewares, route variable converters, error handlers and view handlers (instead of being limited to Closures by Silex). This is achieved by overriding the
CallbackResolver
.
In other words, this brings the resolution logic of enhanced controllers as services to all callbacks in Silex.
Example of a middleware resolved by PHP-DI:
class AuthMiddleware
{
public function beforeRoute(Request $request, Application $app)
{
// ...
}
}
$app->before([AuthMiddleware::class, 'beforeRoute']);
You can view the documentation here.