Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHP-DI:
Introducing the PHP-DI bridge for Slim
Mar 11, 2016 @ 16:15:24

In this new article on the PHP-DI project site they've shared one of the latest tools they've created to make it easier to integrate PHP-DI with the latest version of the Slim microframework (v3).

Slim 3 was released 3 months ago and it was significant. It is one of the first frameworks to integrate the latest standards and concepts in its core.

[...] While PSR-7 and middlewares are very interesting, what's more useful for us is the use of container-interop. That means Slim 3 can work with any dependency injection container. It is very easy to replace the default container (Pimple) with PHP-DI, but today we are releasing a "PHP-DI - Slim" bridge that goes a little further.

They then show how to use their new bridge to create controllers as services in the container and pass them parameters. The post ends with the instructions on getting the PHP-DI bridge installed and how to use it to replace the default AppSlim creation of your application.

tagged: phpdi dependency injection container slim microframework slimframework v3 bridge

Link: http://php-di.org/news/18-slim-bridge-released.html


Trending Topics: