Releases: PHP-DI/Silex-Bridge
Releases · PHP-DI/Silex-Bridge
1.5.2
1.5.1
2.0.0-beta1
First beta of the future 2.0 release.
The main change is the support for Silex 2 (see #17).
1.5.0
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.
1.3.0
1.2.1
1.2.0
1.1.1
1.1.0
-
The request object can now be injected in controllers by adding a parameter named
$request
(type-hint is optional)$app->post('/register/{name}', function (Request $request, Mailer $mailer) { // ... });
-
Query string parameters and POST parameters where previously injected in controllers (if a parameter had the same name). This was bad design, very unconventional and surprising behavior (probably unused) and creates a lot of potential for applications to break, so this has been removed. Inject the whole request to handle those cases.