PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

Pascal Opitz's Blog: An example of how to use Pimple DI with ZF 1.x

Note: This article was originally published at PHPDeveloper on 17 March 2012.
PHPDeveloper

Pascal Opitz has a really quick post to his blog showing a snippet of code about using Pimple with the Zend Framework 1.

After having had a look at Silex, and struggling with the somewhat cumbersome ini configurations and YADIF, I wanted to try out whether I could use Pimple as DI container for ZF 1.x Turns out I can, as you can just select Pimple to be the bootstrap container.

Hsi example (gist of the code here) also shows how to subclass the container and add in some default settings objects into the container. Pimple is a small, lightweight dependency injection container from Fabien Potencier of the Symfony framework.